| #include <metal_stdlib> |
| |
| using namespace metal; |
| struct tint_private_vars_struct { |
| uint local_invocation_index_1; |
| }; |
| |
| void atomicSub_77883a(threadgroup atomic_int* const tint_symbol) { |
| int arg_1 = 0; |
| int res = 0; |
| arg_1 = 1; |
| int const x_19 = arg_1; |
| int const x_15 = atomic_fetch_sub_explicit(tint_symbol, x_19, memory_order_relaxed); |
| res = x_15; |
| return; |
| } |
| |
| void compute_main_inner(uint local_invocation_index_2, threadgroup atomic_int* const tint_symbol_1) { |
| atomic_store_explicit(tint_symbol_1, 0, memory_order_relaxed); |
| threadgroup_barrier(mem_flags::mem_threadgroup); |
| atomicSub_77883a(tint_symbol_1); |
| return; |
| } |
| |
| void compute_main_1(thread tint_private_vars_struct* const tint_private_vars, threadgroup atomic_int* const tint_symbol_2) { |
| uint const x_33 = (*(tint_private_vars)).local_invocation_index_1; |
| compute_main_inner(x_33, tint_symbol_2); |
| return; |
| } |
| |
| void compute_main_inner_1(uint local_invocation_index_1_param, thread tint_private_vars_struct* const tint_private_vars, threadgroup atomic_int* const tint_symbol_3) { |
| { |
| atomic_store_explicit(tint_symbol_3, 0, memory_order_relaxed); |
| } |
| threadgroup_barrier(mem_flags::mem_threadgroup); |
| (*(tint_private_vars)).local_invocation_index_1 = local_invocation_index_1_param; |
| compute_main_1(tint_private_vars, tint_symbol_3); |
| } |
| |
| kernel void compute_main(uint local_invocation_index_1_param [[thread_index_in_threadgroup]]) { |
| thread tint_private_vars_struct tint_private_vars = {}; |
| threadgroup atomic_int tint_symbol_4; |
| compute_main_inner_1(local_invocation_index_1_param, &(tint_private_vars), &(tint_symbol_4)); |
| return; |
| } |
| |