(mode)
| 299 | }); |
| 300 | |
| 301 | function testArray3D2(mode) { |
| 302 | const gpu = new GPU({ mode }); |
| 303 | const texture = ( |
| 304 | gpu.createKernel(function() { return [this.thread.x, this.thread.x * this.thread.y * this.thread.z]; }) |
| 305 | .setOutput([10, 10, 10]) |
| 306 | .setPipeline(true) |
| 307 | .setPrecision('single') |
| 308 | )(); |
| 309 | const expected = texture.toArray(); |
| 310 | const kernel = gpu.createKernel(function() { |
| 311 | return this.constants.value[this.thread.z][this.thread.y][this.thread.x]; |
| 312 | }) |
| 313 | .setConstants({ |
| 314 | value: texture |
| 315 | }) |
| 316 | .setConstantTypes({ |
| 317 | value: 'Array1D(2)' |
| 318 | }) |
| 319 | .setOutput([10, 10, 10]) |
| 320 | .setPipeline(false) |
| 321 | .setPrecision('single'); |
| 322 | |
| 323 | assert.notEqual(texture.constructor, Array); |
| 324 | assert.equal(expected.constructor, Array); |
| 325 | assert.deepEqual(kernel(), expected); |
| 326 | gpu.destroy(); |
| 327 | } |
| 328 | |
| 329 | (GPU.isSinglePrecisionSupported ? test : skip)('Array3D(2) (GPU only) auto', () => { |
| 330 | testArray3D2(); |
no test coverage detected
searching dependent graphs…