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

Function functionCompositionReturnValuesTest

test/internal/function-composition.js:7–15  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

5describe('internal: function composition return values');
6
7function functionCompositionReturnValuesTest(mode) {
8 const gpu = new GPU({ mode });
9 return gpu.createKernel(function(oneToFour, fourToOne) {
10 function add(left, right) {
11 return left[this.thread.x] + right[this.thread.x];
12 }
13 return add(oneToFour, fourToOne);
14 }, { output: [4] })([1,2,3,4], [4,3,2,1]);
15}
16
17test('auto', () => {
18 assert.deepEqual(Array.from(functionCompositionReturnValuesTest()), [5,5,5,5]);

Callers 1

Calls 2

createKernelMethod · 0.95
addFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…