(mode)
| 45 | }); |
| 46 | |
| 47 | function testBitwiseAndUnsignedPrecision(mode) { |
| 48 | const gpu = new GPU({ mode }); |
| 49 | const kernel = gpu.createKernel(function(v1, v2) { |
| 50 | return v1 & v2; |
| 51 | }) |
| 52 | .setOutput([1]) |
| 53 | .setPrecision('unsigned'); |
| 54 | |
| 55 | for (let i = 0; i < 10; i++) { |
| 56 | for (let j = 0; j < 10; j++) { |
| 57 | assert.equal(kernel(i, j)[0], i & j); |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | gpu.destroy(); |
| 62 | } |
| 63 | |
| 64 | test('bitwise AND unsigned precision auto', () => { |
| 65 | testBitwiseAndUnsignedPrecision(); |
no test coverage detected
searching dependent graphs…