(aShape: number[], opSnippet: string)
| 24 | enableShapeUniforms: boolean; |
| 25 | |
| 26 | constructor(aShape: number[], opSnippet: string) { |
| 27 | this.outputShape = aShape; |
| 28 | this.enableShapeUniforms = useShapeUniforms(this.outputShape.length); |
| 29 | this.userCode = ` |
| 30 | float unaryOperation(float x) { |
| 31 | ${opSnippet} |
| 32 | } |
| 33 | |
| 34 | void main() { |
| 35 | float x = getAAtOutCoords(); |
| 36 | float y = unaryOperation(x); |
| 37 | |
| 38 | setOutput(y); |
| 39 | } |
| 40 | `; |
| 41 | } |
| 42 | } |
| 43 | |
| 44 | export const CHECK_NAN_SNIPPET = `if (isnan(x)) return x;`; |
nothing calls this directly
no test coverage detected