Skip to content

Commit 82e76b9

Browse files
committed
Actually add the test
1 parent ea2183e commit 82e76b9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#include <gpuintrin.h>
2+
#include <stdint.h>
3+
4+
[[clang::loader_uninitialized]]
5+
__gpu_local uint32_t shared_mem[64];
6+
7+
__gpu_kernel void localmem_static(uint32_t *out) {
8+
shared_mem[__gpu_thread_id(0)] = 2;
9+
10+
__gpu_sync_threads();
11+
12+
if (__gpu_thread_id(0) == 0) {
13+
out[__gpu_block_id(0)] = 0;
14+
for (uint32_t i = 0; i < __gpu_num_threads(0); i++)
15+
out[__gpu_block_id(0)] += shared_mem[i];
16+
}
17+
}

0 commit comments

Comments
 (0)