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

Function testNestedInCustomFunction

test/features/nested-function.js:54–69  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

52});
53
54function testNestedInCustomFunction(mode) {
55 function custom1() {
56 function nested1() {
57 return 1;
58 }
59
60 return nested1();
61 }
62 const gpu = new GPU({ mode });
63 gpu.addFunction(custom1);
64 const kernel = gpu.createKernel(function() {
65 return custom1();
66 }, { output: [1] });
67 assert.deepEqual(kernel(), new Float32Array([1]));
68 gpu.destroy();
69}
70
71test('nested in custom auto', () => {
72 testNestedInCustomFunction();

Callers 1

nested-function.jsFile · 0.85

Calls 5

addFunctionMethod · 0.95
createKernelMethod · 0.95
destroyMethod · 0.95
custom1Function · 0.85
kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…