(mode)
| 168 | }); |
| 169 | |
| 170 | function testBitwiseXORSinglePrecision(mode) { |
| 171 | const gpu = new GPU({ mode }); |
| 172 | const kernel = gpu.createKernel(function(v1, v2) { |
| 173 | return v1 ^ v2; |
| 174 | }) |
| 175 | .setOutput([1]) |
| 176 | .setPrecision('single'); |
| 177 | |
| 178 | for (let i = 0; i < 10; i++) { |
| 179 | for (let j = 0; j < 10; j++) { |
| 180 | assert.equal(kernel(i, j)[0], i ^ j); |
| 181 | } |
| 182 | } |
| 183 | |
| 184 | gpu.destroy(); |
| 185 | } |
| 186 | |
| 187 | (GPU.isSinglePrecisionSupported ? test : skip)('bitwise XOR single precision auto', () => { |
| 188 | testBitwiseXORSinglePrecision(); |
no test coverage detected
searching dependent graphs…