Add new 'sharedmem' kernel
This commit is contained in:
13
tests/opencl/sharedmem/kernel.cl
Normal file
13
tests/opencl/sharedmem/kernel.cl
Normal file
@@ -0,0 +1,13 @@
|
||||
__kernel void sharedmem (__global volatile const float *src,
|
||||
__global volatile float *dst,
|
||||
__local volatile float *smem)
|
||||
{
|
||||
int gid = get_global_id(0);
|
||||
smem[gid] = src[gid];
|
||||
float read;
|
||||
__attribute__((opencl_unroll_hint))
|
||||
for (int i = 0; i < 500; i++) {
|
||||
read = smem[gid];
|
||||
}
|
||||
dst[gid] = read;
|
||||
}
|
||||
Reference in New Issue
Block a user