(mode)
| 167 | |
| 168 | |
| 169 | function float3DOutput(mode) { |
| 170 | const gpu = new GPU({ mode }); |
| 171 | const cube = [ |
| 172 | [ |
| 173 | [1,2,3,4,5], |
| 174 | [6,7,8,9,10], |
| 175 | [11,12,13,14,15], |
| 176 | ], |
| 177 | [ |
| 178 | [16,17,18,19,20], |
| 179 | [21,22,23,24,25], |
| 180 | [26,27,28,29,30], |
| 181 | ] |
| 182 | ]; |
| 183 | const kernel = gpu.createKernel(function(cube) { |
| 184 | return cube[this.thread.z][this.thread.y][this.thread.x]; |
| 185 | }, { |
| 186 | output: [5, 3, 2], |
| 187 | optimizeFloatMemory: true, |
| 188 | precision: 'single', |
| 189 | }); |
| 190 | const result = kernel(cube); |
| 191 | assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), cube); |
| 192 | gpu.destroy(); |
| 193 | } |
| 194 | |
| 195 | (GPU.isSinglePrecisionSupported ? test : skip)('float 3d output auto', () => { |
| 196 | float3DOutput(); |
no test coverage detected
searching dependent graphs…