(mode)
| 250 | |
| 251 | |
| 252 | function floatPipeline2DOutput(mode) { |
| 253 | const gpu = new GPU({ mode }); |
| 254 | const matrix = [ |
| 255 | [1,2,3,4,5], |
| 256 | [6,7,8,9,10], |
| 257 | [11,12,13,14,15], |
| 258 | ]; |
| 259 | const kernel = gpu.createKernel(function(matrix) { |
| 260 | return matrix[this.thread.y][this.thread.x]; |
| 261 | }, { |
| 262 | output: [5, 3], |
| 263 | optimizeFloatMemory: true, |
| 264 | precision: 'single', |
| 265 | pipeline: true, |
| 266 | }); |
| 267 | const texture = kernel(matrix); |
| 268 | const result = texture.toArray(); |
| 269 | assert.deepEqual(result.map(row => Array.from(row)), matrix); |
| 270 | gpu.destroy(); |
| 271 | } |
| 272 | |
| 273 | |
| 274 | (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 2d output gpu (GPU Only)', () => { |
no test coverage detected
searching dependent graphs…