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

Function inputXY

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

Source from the content-addressed store, hash-verified

40
41
42function inputXY(mode) {
43 const gpu = new GPU({ mode });
44 const kernel = gpu.createKernel(function(a) {
45 return a[this.thread.y][this.thread.x];
46 })
47 .setOutput([9]);
48
49 const a = new Float32Array(9);
50 a.set([1,2,3,4,5,6,7,8,9]);
51
52 const b = new Float32Array(9);
53 b.set([1,2,3,4,5,6,7,8,9]);
54
55 const result = kernel(input(a, [3, 3]));
56 assert.deepEqual(Array.from(result), [1,2,3,4,5,6,7,8,9]);
57 gpu.destroy();
58}
59
60test("inputXY auto", () => {
61 inputXY();

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…