* * @param {IGPUNativeFunction[]} nativeFunctions * @param {GPUMode|GPUInternalMode} [mode]
(nativeFunctions, mode)
| 371 | * @param {GPUMode|GPUInternalMode} [mode] |
| 372 | */ |
| 373 | function testDirectlyOnKernelViaMethod(nativeFunctions, mode) { |
| 374 | const gpu = new GPU({ mode }); |
| 375 | const kernel = gpu.createKernel(function (v) { |
| 376 | return native(v[this.thread.x]); |
| 377 | }, { |
| 378 | output: [1] |
| 379 | }) |
| 380 | .setNativeFunctions(nativeFunctions); |
| 381 | assert.equal(kernel([1])[0], 2); |
| 382 | gpu.destroy(); |
| 383 | } |
| 384 | |
| 385 | test('via method auto', () => { |
| 386 | testDirectlyOnKernelViaMethod([ |
no test coverage detected
searching dependent graphs…