#include using namespace metal; struct SB_RW { /* 0x0000 */ atomic_int arg_0; }; void atomicCompareExchangeWeak_12871c(device SB_RW& sb_rw) { int prev_value = 1; bool matched = atomic_compare_exchange_weak_explicit(&(sb_rw.arg_0), &prev_value, 1, memory_order_relaxed, memory_order_relaxed); int2 res = int2(prev_value, matched); } fragment void fragment_main(device SB_RW& sb_rw [[buffer(0)]]) { atomicCompareExchangeWeak_12871c(sb_rw); return; } kernel void compute_main(device SB_RW& sb_rw [[buffer(0)]]) { atomicCompareExchangeWeak_12871c(sb_rw); return; }