(mode)
| 119 | }); |
| 120 | |
| 121 | function handleCastingFloat(mode) { |
| 122 | const gpu = new GPU({ mode }); |
| 123 | function add(value1, value2) { |
| 124 | return value1 + value2; |
| 125 | } |
| 126 | gpu.addFunction(add, { |
| 127 | argumentTypes: ['Float', 'Float'], |
| 128 | returnType: 'Float' |
| 129 | }); |
| 130 | const kernel = gpu.createKernel(function(value1, value2) { |
| 131 | return add(value1, value2); |
| 132 | }, { |
| 133 | output: [1], |
| 134 | argumentTypes: ['Integer', 'Integer'], |
| 135 | }); |
| 136 | const result = kernel(1, 2); |
| 137 | assert.equal(result[0], 3); |
| 138 | gpu.destroy(); |
| 139 | } |
| 140 | |
| 141 | (GPU.isWebGLSupported ? test : skip)('handle casting float webgl', () => { |
| 142 | handleCastingFloat('webgl'); |
no test coverage detected
searching dependent graphs…