(mode)
| 152 | |
| 153 | |
| 154 | function handleCastingBeforeReturn(mode) { |
| 155 | const gpu = new GPU({ mode }); |
| 156 | function addOne(v) { |
| 157 | return v + v; |
| 158 | } |
| 159 | gpu.addFunction(addOne, { |
| 160 | argumentTypes: { v: 'Float' }, |
| 161 | returnType: 'Integer', |
| 162 | }); |
| 163 | const kernel = gpu.createKernel(function(v) { |
| 164 | return addOne(v); |
| 165 | }, { output: [1] }); |
| 166 | assert.equal(kernel(1)[0], 2); |
| 167 | gpu.destroy(); |
| 168 | } |
| 169 | |
| 170 | (GPU.isWebGLSupported ? test : skip)('handle casting before return webgl', () => { |
| 171 | handleCastingBeforeReturn('webgl'); |
no test coverage detected
searching dependent graphs…