| #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_private_vars_struct { |
| uint3 gl_GlobalInvocationID; |
| }; |
| |
| struct ResultMatrix { |
| /* 0x0000 */ tint_array<float, 1> numbers; |
| }; |
| |
| struct FirstMatrix { |
| tint_array<float, 1> numbers; |
| }; |
| |
| struct SecondMatrix { |
| tint_array<float, 1> numbers; |
| }; |
| |
| struct Uniforms { |
| float tint_symbol; |
| int sizeA; |
| int sizeB; |
| }; |
| |
| float binaryOperation_f1_f1_(thread float* const a, thread float* const b) { |
| float x_26 = 0.0f; |
| if ((*(b) == 0.0f)) { |
| return 1.0f; |
| } |
| float const x_21 = *(b); |
| if (!((rint((x_21 - (2.0f * floor((x_21 / 2.0f))))) == 1.0f))) { |
| x_26 = pow(fabs(*(a)), *(b)); |
| } else { |
| x_26 = (sign(*(a)) * pow(fabs(*(a)), *(b))); |
| } |
| float const x_41 = x_26; |
| return x_41; |
| } |
| |
| void main_1(thread tint_private_vars_struct* const tint_private_vars, device ResultMatrix* const tint_symbol_2) { |
| int index = 0; |
| int a_1 = 0; |
| float param = 0.0f; |
| float param_1 = 0.0f; |
| index = as_type<int>((*(tint_private_vars)).gl_GlobalInvocationID[0]); |
| a_1 = -10; |
| int const x_63 = index; |
| param = -4.0f; |
| param_1 = -3.0f; |
| float const x_68 = binaryOperation_f1_f1_(&(param), &(param_1)); |
| (*(tint_symbol_2)).numbers[x_63] = x_68; |
| return; |
| } |
| |
| void tint_symbol_1_inner(uint3 gl_GlobalInvocationID_param, thread tint_private_vars_struct* const tint_private_vars, device ResultMatrix* const tint_symbol_3) { |
| (*(tint_private_vars)).gl_GlobalInvocationID = gl_GlobalInvocationID_param; |
| main_1(tint_private_vars, tint_symbol_3); |
| } |
| |
| kernel void tint_symbol_1(device ResultMatrix* tint_symbol_4 [[buffer(0)]], uint3 gl_GlobalInvocationID_param [[thread_position_in_grid]]) { |
| thread tint_private_vars_struct tint_private_vars = {}; |
| tint_symbol_1_inner(gl_GlobalInvocationID_param, &(tint_private_vars), tint_symbol_4); |
| return; |
| } |
| |