diff options
author | Cedric Nugteren <web@cedricnugteren.nl> | 2017-10-17 19:53:09 +0200 |
---|---|---|
committer | Cedric Nugteren <web@cedricnugteren.nl> | 2017-10-17 19:53:09 +0200 |
commit | f349731d5498f484995514112551c1b60ca4f6d3 (patch) | |
tree | 1b038e62f42d80a3d60a8b545a25c25d5b8c5d50 /src | |
parent | 03760f80eb7eb07450da379d129ba64d92bfcc41 (diff) |
CUDA kernel compilation fixes
Diffstat (limited to 'src')
-rw-r--r-- | src/kernels/level2/level2.opencl | 2 | ||||
-rw-r--r-- | src/kernels/opencl_to_cuda.h | 5 |
2 files changed, 6 insertions, 1 deletions
diff --git a/src/kernels/level2/level2.opencl b/src/kernels/level2/level2.opencl index 505231ca..ff46c2a5 100644 --- a/src/kernels/level2/level2.opencl +++ b/src/kernels/level2/level2.opencl @@ -34,7 +34,7 @@ R"( // Returns an element from a vector INLINE_FUNC real LoadVector(const int id, const int max, - __global real* gm, const int offset, const int inc, + const __global real* gm, const int offset, const int inc, const int do_conjugate) { if (id < max) { real result = gm[id*inc + offset]; diff --git a/src/kernels/opencl_to_cuda.h b/src/kernels/opencl_to_cuda.h index e8206764..5682a456 100644 --- a/src/kernels/opencl_to_cuda.h +++ b/src/kernels/opencl_to_cuda.h @@ -31,6 +31,11 @@ __device__ int get_group_id(const int x) { if (x == 1) { return blockIdx.y; } return blockIdx.z; } +__device__ int get_local_size(const int x) { + if (x == 0) { return blockDim.x; } + if (x == 1) { return blockDim.y; } + return blockDim.z; +} __device__ int get_num_groups(const int x) { if (x == 0) { return gridDim.x; } if (x == 1) { return gridDim.y; } |