summaryrefslogtreecommitdiff
path: root/src/kernels/common.opencl
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernels/common.opencl')
-rw-r--r--src/kernels/common.opencl27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/kernels/common.opencl b/src/kernels/common.opencl
index 9481881e..a34877d9 100644
--- a/src/kernels/common.opencl
+++ b/src/kernels/common.opencl
@@ -23,15 +23,18 @@ R"(
#endif
// =================================================================================================
+#ifndef CUDA
-// Enable support for double-precision
-#if PRECISION == 16
- #pragma OPENCL EXTENSION cl_khr_fp16: enable
-#endif
+ // Enable support for double-precision
+ #if PRECISION == 16
+ #pragma OPENCL EXTENSION cl_khr_fp16: enable
+ #endif
+
+ // Enable support for double-precision
+ #if PRECISION == 64 || PRECISION == 6464
+ #pragma OPENCL EXTENSION cl_khr_fp64: enable
+ #endif
-// Enable support for double-precision
-#if PRECISION == 64 || PRECISION == 6464
- #pragma OPENCL EXTENSION cl_khr_fp64: enable
#endif
// Half-precision
@@ -254,18 +257,18 @@ R"(
// http://docs.nvidia.com/cuda/samples/6_Advanced/transpose/doc/MatrixTranspose.pdf
// More details: https://github.com/CNugteren/CLBlast/issues/53
#if USE_STAGGERED_INDICES == 1
- INLINE_FUNC size_t GetGroupIDFlat() {
+ INLINE_FUNC int GetGroupIDFlat() {
return get_group_id(0) + get_num_groups(0) * get_group_id(1);
}
- INLINE_FUNC size_t GetGroupID1() {
+ INLINE_FUNC int GetGroupID1() {
return (GetGroupIDFlat()) % get_num_groups(1);
}
- INLINE_FUNC size_t GetGroupID0() {
+ INLINE_FUNC int GetGroupID0() {
return ((GetGroupIDFlat() / get_num_groups(1)) + GetGroupID1()) % get_num_groups(0);
}
#else
- INLINE_FUNC size_t GetGroupID1() { return get_group_id(1); }
- INLINE_FUNC size_t GetGroupID0() { return get_group_id(0); }
+ INLINE_FUNC int GetGroupID1() { return get_group_id(1); }
+ INLINE_FUNC int GetGroupID0() { return get_group_id(0); }
#endif
// =================================================================================================