| 1 | #include <gpuintrin.h> |
|---|---|
| 2 | #include <stdint.h> |
| 3 | |
| 4 | extern __gpu_local uint32_t shared_mem[]; |
| 5 | |
| 6 | __gpu_kernel void localmem(uint32_t *out) { |
| 7 | shared_mem[__gpu_thread_id(0)] = __gpu_thread_id(0); |
| 8 | shared_mem[__gpu_thread_id(0)] *= 2; |
| 9 | out[__gpu_thread_id(0) + (__gpu_num_threads(0) * __gpu_block_id(0))] = |
| 10 | shared_mem[__gpu_thread_id(0)]; |
| 11 | } |
| 12 |
