(mode)
| 289 | |
| 290 | |
| 291 | function floatPipeline3DOutput(mode) { |
| 292 | const gpu = new GPU({ mode }); |
| 293 | const cube = [ |
| 294 | [ |
| 295 | [1,2,3,4,5], |
| 296 | [6,7,8,9,10], |
| 297 | [11,12,13,14,15], |
| 298 | ], |
| 299 | [ |
| 300 | [16,17,18,19,20], |
| 301 | [21,22,23,24,25], |
| 302 | [26,27,28,29,30], |
| 303 | ] |
| 304 | ]; |
| 305 | const kernel = gpu.createKernel(function(cube) { |
| 306 | return cube[this.thread.z][this.thread.y][this.thread.x]; |
| 307 | }, { |
| 308 | output: [5, 3, 2], |
| 309 | optimizeFloatMemory: true, |
| 310 | precision: 'single', |
| 311 | pipeline: true, |
| 312 | }); |
| 313 | const result = kernel(cube).toArray(); |
| 314 | assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), cube); |
| 315 | gpu.destroy(); |
| 316 | } |
| 317 | |
| 318 | |
| 319 | (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 3d output gpu (GPU only)', () => { |
no test coverage detected
searching dependent graphs…