(destSize: number[])
| 26 | customUniforms: Array<{name: string; arrayIndex: number; type: UniformType;}>; |
| 27 | |
| 28 | constructor(destSize: number[]) { |
| 29 | this.outputShape = destSize; |
| 30 | this.rank = destSize.length; |
| 31 | |
| 32 | const dtype = getCoordsDataType(this.rank); |
| 33 | this.customUniforms = [{name: 'start', arrayIndex: this.rank, type: 'int'}]; |
| 34 | const sourceCoords = getCoords(this.rank); |
| 35 | |
| 36 | let body: string; |
| 37 | const coordSum = destSize.map((_, i) => { |
| 38 | return `sourceLoc.${coords[i]} = start[${i}] + coords.${coords[i]};`; |
| 39 | }); |
| 40 | body = ` |
| 41 | ${dtype} sourceLoc; |
| 42 | ${dtype} coords = getOutputCoords(); |
| 43 | ${coordSum.join('\n')} |
| 44 | `; |
| 45 | this.userCode = ` |
| 46 | void main() { |
| 47 | ${body} |
| 48 | setOutput(getSource(${sourceCoords})); |
| 49 | } |
| 50 | `; |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | const coords = ['x', 'y', 'z', 'w', 'u', 'v']; |
nothing calls this directly
no test coverage detected