(mode)
| 4 | describe('internal: tactic'); |
| 5 | |
| 6 | function speedTest(mode) { |
| 7 | const gpu = new GPU({ mode }); |
| 8 | const add = gpu.createKernel(function(a, b) { |
| 9 | return a + b; |
| 10 | }) |
| 11 | .setOutput([1]) |
| 12 | .setTactic('speed'); |
| 13 | let addResult = add(0.1, 0.2)[0]; |
| 14 | assert.equal(addResult.toFixed(7), (0.1 + 0.2).toFixed(7)); |
| 15 | gpu.destroy(); |
| 16 | } |
| 17 | |
| 18 | test('speed auto', () => { |
| 19 | speedTest(); |