summaryrefslogtreecommitdiff
path: root/kernels/compiler_read_buffer.cl
diff options
context:
space:
mode:
Diffstat (limited to 'kernels/compiler_read_buffer.cl')
-rw-r--r--kernels/compiler_read_buffer.cl15
1 files changed, 15 insertions, 0 deletions
diff --git a/kernels/compiler_read_buffer.cl b/kernels/compiler_read_buffer.cl
new file mode 100644
index 00000000..4d3183a1
--- /dev/null
+++ b/kernels/compiler_read_buffer.cl
@@ -0,0 +1,15 @@
+#define COUNT 16
+
+__kernel void
+compiler_read_buffer(__global float4* src0, __global float4* src1, __global float4* dst)
+{
+ float4 sum = 0;
+ int offset = 0, i = 0;
+ int id = (int)get_global_id(0);
+ int sz = (int)get_global_size(0);
+ for(i=0; i<COUNT; i++) {
+ sum = sum + src0[offset + id] + src1[offset + id];
+ offset += sz;
+ }
+ dst[id] = sum;
+}