diff options
author | Yang Rong <rong.r.yang@intel.com> | 2015-01-09 09:38:47 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-01-09 10:25:58 +0800 |
commit | 17fae996979c86e76e91f1ff79950562c3f986e0 (patch) | |
tree | 034ae4835b836d02c3a4494ec92f7889845c0efd /kernels/compiler_read_buffer.cl | |
parent | 8a51c74d2e17e5461a3e0b0d00ac2c6d58767654 (diff) | |
download | beignet-17fae996979c86e76e91f1ff79950562c3f986e0.tar.gz |
Add read buffer/image benchmark.
Add there two benchmark to compare the buffer and image performance
V2: init the coord before read image.
V3: Correct the image's width and buffer's read index.
Signed-off-by: Yang Rong <rong.r.yang@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'kernels/compiler_read_buffer.cl')
-rw-r--r-- | kernels/compiler_read_buffer.cl | 15 |
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; +} |