(mode)
| 148 | }); |
| 149 | |
| 150 | function testArray2D2(mode) { |
| 151 | const gpu = new GPU({ mode }); |
| 152 | const texture = ( |
| 153 | gpu.createKernel(function() { return [this.thread.x, this.thread.y]; }) |
| 154 | .setOutput([10, 10]) |
| 155 | .setPipeline(true) |
| 156 | .setPrecision('single') |
| 157 | )(); |
| 158 | const expected = texture.toArray(); |
| 159 | const kernel = gpu.createKernel(function() { |
| 160 | return this.constants.value[this.thread.y][this.thread.x]; |
| 161 | }) |
| 162 | .setConstants({ |
| 163 | value: texture |
| 164 | }) |
| 165 | .setConstantTypes({ |
| 166 | value: 'Array1D(2)' |
| 167 | }) |
| 168 | .setOutput([10, 10]) |
| 169 | .setPipeline(false) |
| 170 | .setPrecision('single'); |
| 171 | |
| 172 | assert.notEqual(texture.constructor, Array); |
| 173 | assert.equal(expected.constructor, Array); |
| 174 | assert.deepEqual(kernel(), expected); |
| 175 | gpu.destroy(); |
| 176 | } |
| 177 | |
| 178 | (GPU.isSinglePrecisionSupported ? test : skip)('Array2D(2) (GPU only) auto', () => { |
| 179 | testArray2D2(); |
no test coverage detected
searching dependent graphs…