| #include <metal_stdlib> |
| using namespace metal; |
| |
| template<typename T, size_t N> |
| struct tint_array { |
| const constant T& operator[](size_t i) const constant { return elements[i]; } |
| device T& operator[](size_t i) device { return elements[i]; } |
| const device T& operator[](size_t i) const device { return elements[i]; } |
| thread T& operator[](size_t i) thread { return elements[i]; } |
| const thread T& operator[](size_t i) const thread { return elements[i]; } |
| threadgroup T& operator[](size_t i) threadgroup { return elements[i]; } |
| const threadgroup T& operator[](size_t i) const threadgroup { return elements[i]; } |
| T elements[N]; |
| }; |
| |
| struct tint_module_vars_struct { |
| threadgroup tint_array<uchar, 1024>* v; |
| }; |
| |
| struct tint_symbol_1 { |
| tint_array<uchar, 1024> tint_symbol; |
| }; |
| |
| void main_inner(uint tint_local_index, tint_module_vars_struct tint_module_vars) { |
| { |
| uint v_1 = 0u; |
| v_1 = tint_local_index; |
| while(true) { |
| uint const v_2 = v_1; |
| if ((v_2 >= 1024u)) { |
| break; |
| } |
| (*tint_module_vars.v)[v_2] = 0u; |
| { |
| v_1 = (v_2 + 32u); |
| } |
| } |
| } |
| (threadgroup_barrier(mem_flags::mem_threadgroup)); |
| threadgroup tint_array<float, 1>* const view = reinterpret_cast<threadgroup tint_array<float, 1>*>(reinterpret_cast<threadgroup char*>(tint_module_vars.v) + 0u); |
| uint const v_3 = as_type<uint>(0); |
| uint const v_4 = as_type<uint>(8); |
| bool const v_5 = (((v_3 + (v_4 * 7u)) + 8u) <= ((1024u - 0u) / 4u)); |
| simdgroup_float8x8 v_6 = make_filled_simdgroup_matrix<float, 8, 8>(0.0f); |
| (simdgroup_load(v_6, (&(*view)[select(0u, v_3, v_5)]), ulong(select(8u, v_4, v_5)), ulong2(0ul), true)); |
| simdgroup_float8x8 const m = v_6; |
| uint const v_7 = as_type<uint>(0); |
| uint const v_8 = as_type<uint>(8); |
| bool const v_9 = (((v_7 + (v_8 * 7u)) + 8u) <= ((1024u - 0u) / 4u)); |
| (simdgroup_store(m, (&(*view)[select(0u, v_7, v_9)]), ulong(select(8u, v_8, v_9)), ulong2(0ul), false)); |
| } |
| |
| [[max_total_threads_per_threadgroup(32)]] |
| kernel void v_10(uint tint_local_index [[thread_index_in_threadgroup]], threadgroup tint_symbol_1* v_11 [[threadgroup(0)]]) { |
| tint_module_vars_struct const tint_module_vars = tint_module_vars_struct{.v=(&(*v_11).tint_symbol)}; |
| (main_inner(tint_local_index, tint_module_vars)); |
| } |