diff options
Diffstat (limited to 'handcoded-opencl/sql11.cl.works')
-rw-r--r-- | handcoded-opencl/sql11.cl.works | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/handcoded-opencl/sql11.cl.works b/handcoded-opencl/sql11.cl.works new file mode 100644 index 0000000..6d2e23f --- /dev/null +++ b/handcoded-opencl/sql11.cl.works @@ -0,0 +1,20 @@ +__kernel void x1_search_kernel(int totalRows, + int stride, + __global float *data, + __global float *resultArray) { + + int i = get_global_id(0); + int workingSet = totalRows/4; + int startRow = i * workingSet; + int endOffset = (startRow + workingSet)*stride; + size_t offset = (startRow*stride)+6; + float accum = 0.0f; + + if (i == 3) + endOffset = totalRows * stride; + for(;offset < endOffset; offset+=stride) { + accum += data[offset]; + } + + resultArray[i] = accum; +} |