Ross Brunton bed9fe77dc
[Offload] Tests for global memory and constructors (#147537)
Adds two "launch kernel" tests for lib offload, one testing that
global memory works and persists between different kernels, and one
verifying that `[[gnu::constructor]]` works correctly.

Since we now have tests that contain multiple kernels in the same
binary, the test framework has been updated a bit.
2025-07-09 14:26:50 +01:00

14 lines
205 B
C

#include <gpuintrin.h>
#include <stdint.h>
uint32_t global[64];
[[gnu::destructor]] void dtor() {
for (unsigned I = 0; I < 64; I++)
global[I] = 1;
}
__gpu_kernel void global_dtor() {
// no-op
}