(mode)
| 52 | }); |
| 53 | |
| 54 | function testArray1D3(mode) { |
| 55 | const gpu = new GPU({ mode }); |
| 56 | const texture = ( |
| 57 | gpu.createKernel(function() { return [this.thread.x, this.thread.x + 1, this.thread.x + 2]; }) |
| 58 | .setOutput([10]) |
| 59 | .setPipeline(true) |
| 60 | .setPrecision('single') |
| 61 | )(); |
| 62 | const expected = texture.toArray(); |
| 63 | const kernel = gpu.createKernel(function() { |
| 64 | return this.constants.value[this.thread.x]; |
| 65 | }) |
| 66 | .setConstants({ |
| 67 | value: texture |
| 68 | }) |
| 69 | .setConstantTypes({ |
| 70 | value: 'Array1D(2)' |
| 71 | }) |
| 72 | .setOutput([10]) |
| 73 | .setPipeline(false) |
| 74 | .setPrecision('single'); |
| 75 | |
| 76 | assert.notEqual(texture.constructor, Array); |
| 77 | assert.equal(expected.constructor, Array); |
| 78 | assert.deepEqual(kernel(), expected); |
| 79 | gpu.destroy(); |
| 80 | } |
| 81 | |
| 82 | (GPU.isSinglePrecisionSupported ? test : skip)('Array1D(3) (GPU only) auto', () => { |
| 83 | testArray1D3(); |
no test coverage detected
searching dependent graphs…