(mode)
| 83 | }); |
| 84 | |
| 85 | function singlePrecision(mode) { |
| 86 | const gpu = new GPU({ mode }); |
| 87 | const array = [1,2,3,4,5]; |
| 88 | const kernel = gpu.createKernel(function(array) { |
| 89 | return array[this.thread.x]; |
| 90 | }, { |
| 91 | output: [5], |
| 92 | optimizeFloatMemory: true, |
| 93 | precision: 'single', |
| 94 | }); |
| 95 | const result = kernel(array); |
| 96 | assert.deepEqual(Array.from(result), array); |
| 97 | gpu.destroy(); |
| 98 | } |
| 99 | |
| 100 | (GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('single precision auto', () => { |
| 101 | singlePrecision(); |
no test coverage detected
searching dependent graphs…