Add new 'sharedmem' kernel

This commit is contained in:
Hansung Kim
2024-01-01 13:56:46 -08:00
parent dd289ef964
commit 1586ea93ef
6 changed files with 245 additions and 0 deletions

View 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;
}