blob: c284e1a5eae7c8f711ea7818f7d4a5b5502b77e6 [file] [log] [blame]
#include <metal_stdlib>
using namespace metal;
struct atomic_compare_exchange_resultu32 {
uint old_value;
bool exchanged;
};
template <typename A, typename T>
atomic_compare_exchange_resultu32 atomicCompareExchangeWeak_1(device A* atomic, T compare, T value) {
T old_value = compare;
bool exchanged = atomic_compare_exchange_weak_explicit(atomic, &old_value, value, memory_order_relaxed, memory_order_relaxed);
return {old_value, exchanged};
}
kernel void tint_symbol(device atomic_uint* tint_symbol_1 [[buffer(0)]]) {
uint value = 42u;
atomic_compare_exchange_resultu32 const result = atomicCompareExchangeWeak_1(tint_symbol_1, 0u, value);
return;
}