(mode)
| 4 | describe('feature: bitwise operators'); |
| 5 | |
| 6 | function testBitwiseAndSinglePrecision(mode) { |
| 7 | const gpu = new GPU({ mode }); |
| 8 | const kernel = gpu.createKernel(function(v1, v2) { |
| 9 | return v1 & v2; |
| 10 | }) |
| 11 | .setOutput([1]) |
| 12 | .setPrecision('single'); |
| 13 | |
| 14 | for (let i = 0; i < 10; i++) { |
| 15 | for (let j = 0; j < 10; j++) { |
| 16 | assert.equal(kernel(i, j)[0], i & j); |
| 17 | } |
| 18 | } |
| 19 | |
| 20 | gpu.destroy(); |
| 21 | } |
| 22 | |
| 23 | (GPU.isSinglePrecisionSupported ? test : skip)('bitwise AND single precision auto', () => { |
| 24 | testBitwiseAndSinglePrecision(); |
no test coverage detected
searching dependent graphs…