1#include <metal_stdlib> 2 3using namespace metal; 4 5template <typename A, typename T> 6vec<T, 2> atomicCompareExchangeWeak_1(device A* atomic, T compare, T value) { 7 T prev_value = compare; 8 bool matched = atomic_compare_exchange_weak_explicit(atomic, &prev_value, value, memory_order_relaxed, memory_order_relaxed); 9 return {prev_value, matched}; 10} 11 12struct SB_RW { 13 /* 0x0000 */ atomic_uint arg_0; 14}; 15 16void atomicCompareExchangeWeak_6673da(device SB_RW* const tint_symbol) { 17 uint2 res = atomicCompareExchangeWeak_1(&((*(tint_symbol)).arg_0), 1u, 1u); 18} 19 20fragment void fragment_main(device SB_RW* tint_symbol_1 [[buffer(0)]]) { 21 atomicCompareExchangeWeak_6673da(tint_symbol_1); 22 return; 23} 24 25kernel void compute_main(device SB_RW* tint_symbol_2 [[buffer(0)]]) { 26 atomicCompareExchangeWeak_6673da(tint_symbol_2); 27 return; 28} 29 30