2021-07-06 09:43:49 +00:00
|
|
|
#include <metal_stdlib>
|
|
|
|
|
|
|
|
using namespace metal;
|
|
|
|
struct ssbOut {
|
|
|
|
/* 0x0000 */ float result[1];
|
|
|
|
};
|
2022-02-09 23:55:51 +00:00
|
|
|
|
2021-07-06 09:43:49 +00:00
|
|
|
struct ssbA {
|
|
|
|
/* 0x0000 */ float A[1];
|
|
|
|
};
|
2022-02-09 23:55:51 +00:00
|
|
|
|
2021-07-06 09:43:49 +00:00
|
|
|
struct Uniforms {
|
|
|
|
/* 0x0000 */ float tint_symbol;
|
|
|
|
/* 0x0004 */ int aShape;
|
|
|
|
/* 0x0008 */ int outShape;
|
|
|
|
/* 0x000c */ int outShapeStrides;
|
|
|
|
/* 0x0010 */ int size;
|
|
|
|
};
|
|
|
|
|
2021-10-28 15:00:39 +00:00
|
|
|
float getAAtOutCoords_(thread uint3* const tint_symbol_2, const device ssbA* const tint_symbol_3) {
|
2021-10-20 16:12:33 +00:00
|
|
|
uint const x_42 = (*(tint_symbol_2))[0];
|
2021-10-28 15:00:39 +00:00
|
|
|
float const x_44 = (*(tint_symbol_3)).A[x_42];
|
2021-07-06 09:43:49 +00:00
|
|
|
return x_44;
|
|
|
|
}
|
|
|
|
|
|
|
|
float unaryOperation_f1_(thread float* const a) {
|
|
|
|
float const x_47 = *(a);
|
|
|
|
if ((x_47 < 0.0f)) {
|
|
|
|
return INFINITY;
|
|
|
|
}
|
|
|
|
float const x_55 = *(a);
|
|
|
|
return log(x_55);
|
|
|
|
}
|
|
|
|
|
2021-10-28 15:00:39 +00:00
|
|
|
void setOutput_i1_f1_(thread int* const flatIndex, thread float* const value, device ssbOut* const tint_symbol_4) {
|
2021-07-06 09:43:49 +00:00
|
|
|
int const x_27 = *(flatIndex);
|
|
|
|
float const x_28 = *(value);
|
2021-10-28 15:00:39 +00:00
|
|
|
(*(tint_symbol_4)).result[x_27] = x_28;
|
2021-07-06 09:43:49 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-28 15:00:39 +00:00
|
|
|
void main_1(thread uint3* const tint_symbol_5, const constant Uniforms* const tint_symbol_6, const device ssbA* const tint_symbol_7, device ssbOut* const tint_symbol_8) {
|
2021-07-06 09:43:49 +00:00
|
|
|
int index = 0;
|
|
|
|
float a_1 = 0.0f;
|
|
|
|
float param = 0.0f;
|
|
|
|
int param_1 = 0;
|
|
|
|
float param_2 = 0.0f;
|
2021-10-28 15:00:39 +00:00
|
|
|
uint const x_61 = (*(tint_symbol_5))[0];
|
2021-07-06 09:43:49 +00:00
|
|
|
index = as_type<int>(x_61);
|
|
|
|
int const x_63 = index;
|
2021-10-28 15:00:39 +00:00
|
|
|
int const x_70 = (*(tint_symbol_6)).size;
|
2021-07-06 09:43:49 +00:00
|
|
|
if ((x_63 < x_70)) {
|
2021-10-28 15:00:39 +00:00
|
|
|
float const x_75 = getAAtOutCoords_(tint_symbol_5, tint_symbol_7);
|
2021-07-06 09:43:49 +00:00
|
|
|
a_1 = x_75;
|
|
|
|
float const x_77 = a_1;
|
|
|
|
param = x_77;
|
|
|
|
float const x_78 = unaryOperation_f1_(&(param));
|
|
|
|
int const x_80 = index;
|
|
|
|
param_1 = x_80;
|
|
|
|
param_2 = x_78;
|
2021-10-28 15:00:39 +00:00
|
|
|
setOutput_i1_f1_(&(param_1), &(param_2), tint_symbol_8);
|
2021-07-06 09:43:49 +00:00
|
|
|
}
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2021-10-28 15:00:39 +00:00
|
|
|
void tint_symbol_1_inner(uint3 gl_GlobalInvocationID_param, thread uint3* const tint_symbol_9, const constant Uniforms* const tint_symbol_10, const device ssbA* const tint_symbol_11, device ssbOut* const tint_symbol_12) {
|
|
|
|
*(tint_symbol_9) = gl_GlobalInvocationID_param;
|
|
|
|
main_1(tint_symbol_9, tint_symbol_10, tint_symbol_11, tint_symbol_12);
|
2021-08-04 22:15:28 +00:00
|
|
|
}
|
|
|
|
|
2021-10-28 15:00:39 +00:00
|
|
|
kernel void tint_symbol_1(const constant Uniforms* tint_symbol_14 [[buffer(0)]], const device ssbA* tint_symbol_15 [[buffer(2)]], device ssbOut* tint_symbol_16 [[buffer(1)]], uint3 gl_GlobalInvocationID_param [[thread_position_in_grid]]) {
|
|
|
|
thread uint3 tint_symbol_13 = 0u;
|
|
|
|
tint_symbol_1_inner(gl_GlobalInvocationID_param, &(tint_symbol_13), tint_symbol_14, tint_symbol_15, tint_symbol_16);
|
2021-07-06 09:43:49 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|