MCPcopy
hub / github.com/gpujs/gpu.js / inputX

Function inputX

test/features/input.js:6–19  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

4describe('input');
5
6function inputX(mode) {
7 const gpu = new GPU({ mode });
8 const kernel = gpu.createKernel(function(a) {
9 return a[this.thread.x];
10 })
11 .setOutput([9]);
12
13 const a = new Float32Array(9);
14 a.set([1,2,3,4,5,6,7,8,9]);
15
16 const result = kernel(input(a, [3, 3]));
17 assert.deepEqual(Array.from(result), [1,2,3,4,5,6,7,8,9]);
18 gpu.destroy();
19}
20
21test("inputX auto", () => {
22 inputX();

Callers 1

input.jsFile · 0.85

Calls 5

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
inputFunction · 0.85
setOutputMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…