summaryrefslogtreecommitdiff
path: root/src/kernels/level1/xaxpy.opencl
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernels/level1/xaxpy.opencl')
-rw-r--r--src/kernels/level1/xaxpy.opencl24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/kernels/level1/xaxpy.opencl b/src/kernels/level1/xaxpy.opencl
index 772b57f3..b20ad200 100644
--- a/src/kernels/level1/xaxpy.opencl
+++ b/src/kernels/level1/xaxpy.opencl
@@ -22,7 +22,11 @@ R"(
// =================================================================================================
// Full version of the kernel with offsets and strided accesses
-__kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#if RELAX_WORKGROUP_SIZE == 1
+ __kernel
+#elif
+ __kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#endif
void Xaxpy(const int n, const real_arg arg_alpha,
const __global real* restrict xgm, const int x_offset, const int x_inc,
__global real* ygm, const int y_offset, const int y_inc) {
@@ -37,7 +41,11 @@ void Xaxpy(const int n, const real_arg arg_alpha,
// Faster version of the kernel without offsets and strided accesses but with if-statement. Also
// assumes that 'n' is dividable by 'VW' and 'WPT'.
-__kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#if RELAX_WORKGROUP_SIZE == 1
+ __kernel
+#elif
+ __kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#endif
void XaxpyFaster(const int n, const real_arg arg_alpha,
const __global realV* restrict xgm,
__global realV* ygm) {
@@ -57,7 +65,11 @@ void XaxpyFaster(const int n, const real_arg arg_alpha,
// Faster version of the kernel without offsets and strided accesses. Also assumes that 'n' is
// dividable by 'VW', 'WGS' and 'WPT'.
-__kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#if RELAX_WORKGROUP_SIZE == 1
+ __kernel
+#elif
+ __kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#endif
void XaxpyFastest(const int n, const real_arg arg_alpha,
const __global realV* restrict xgm,
__global realV* ygm) {
@@ -75,7 +87,11 @@ void XaxpyFastest(const int n, const real_arg arg_alpha,
// =================================================================================================
// Full version of the kernel with offsets and strided accesses: batched version
-__kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#if RELAX_WORKGROUP_SIZE == 1
+ __kernel
+#elif
+ __kernel __attribute__((reqd_work_group_size(WGS, 1, 1)))
+#endif
void XaxpyBatched(const int n, const __constant real_arg* arg_alphas,
const __global real* restrict xgm, const __constant int* x_offsets, const int x_inc,
__global real* ygm, const __constant int* y_offsets, const int y_inc) {