MCPcopy Index your code
hub / github.com/gpujs/gpu.js / testDirectlyOnKernelViaMethod

Function testDirectlyOnKernelViaMethod

test/features/add-custom-native-function.js:373–383  ·  view source on GitHub ↗

* * @param {IGPUNativeFunction[]} nativeFunctions * @param {GPUMode|GPUInternalMode} [mode]

(nativeFunctions, mode)

Source from the content-addressed store, hash-verified

371 * @param {GPUMode|GPUInternalMode} [mode]
372 */
373function 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
385test('via method auto', () => {
386 testDirectlyOnKernelViaMethod([

Callers 1

Calls 4

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
setNativeFunctionsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…