(mode)
| 347 | }); |
| 348 | |
| 349 | function testArray3D3(mode) { |
| 350 | const gpu = new GPU({ mode }); |
| 351 | const texture = ( |
| 352 | gpu.createKernel(function() { return [this.thread.x, this.thread.y, this.thread.z]; }) |
| 353 | .setOutput([10, 10, 10]) |
| 354 | .setPipeline(true) |
| 355 | .setPrecision('single') |
| 356 | )(); |
| 357 | const expected = texture.toArray(); |
| 358 | const kernel = gpu.createKernel(function() { |
| 359 | return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; |
| 360 | }) |
| 361 | .setConstants({ |
| 362 | value: texture |
| 363 | }) |
| 364 | .setConstantTypes({ |
| 365 | value: 'Array1D(2)' |
| 366 | }) |
| 367 | .setOutput([10, 10, 10]) |
| 368 | .setPipeline(false) |
| 369 | .setPrecision('single'); |
| 370 | |
| 371 | assert.notEqual(texture.constructor, Array); |
| 372 | assert.equal(expected.constructor, Array); |
| 373 | assert.deepEqual(kernel(), expected); |
| 374 | gpu.destroy(); |
| 375 | } |
| 376 | |
| 377 | (GPU.isSinglePrecisionSupported ? test : skip)('Array3D(3) (GPU only) auto', () => { |
| 378 | testArray3D3(); |
no test coverage detected
searching dependent graphs…