blob: 3602800462f296066122f3bb1cc62d284e77f9a5 [file] [log] [blame]
Ben Claytonf2ec7f32021-06-29 11:53:15 +00001#include <metal_stdlib>
Ben Clayton6a772362021-06-18 18:56:13 +00002
Ben Claytonf2ec7f32021-06-29 11:53:15 +00003using namespace metal;
Ben Clayton6a772362021-06-18 18:56:13 +00004struct SB_RW {
Ben Claytonf2ec7f32021-06-29 11:53:15 +00005 /* 0x0000 */ atomic_int arg_0;
Ben Clayton0a32a722021-06-18 18:56:13 +00006};
7
Ben Claytonf2ec7f32021-06-29 11:53:15 +00008void atomicOr_8d96a0(device SB_RW& sb_rw) {
9 int res = atomic_fetch_or_explicit(&(sb_rw.arg_0), 1, memory_order_relaxed);
Ben Clayton0a32a722021-06-18 18:56:13 +000010}
11
Ben Claytonf2ec7f32021-06-29 11:53:15 +000012fragment void fragment_main(device SB_RW& sb_rw [[buffer(0)]]) {
13 atomicOr_8d96a0(sb_rw);
14 return;
Ben Clayton0a32a722021-06-18 18:56:13 +000015}
16
Ben Claytonf2ec7f32021-06-29 11:53:15 +000017kernel void compute_main(device SB_RW& sb_rw [[buffer(0)]]) {
18 atomicOr_8d96a0(sb_rw);
19 return;
Ben Clayton0a32a722021-06-18 18:56:13 +000020}
21