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

Function inputYXOffset

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

Source from the content-addressed store, hash-verified

121});
122
123function inputYXOffset(mode) {
124 const gpu = new GPU({ mode });
125 const kernel = gpu.createKernel(function(a) {
126 return a[this.thread.x][this.thread.y];
127 })
128 .setOutput([8, 2]);
129
130 const a = new Float32Array(16);
131 a.set([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
132
133 const result = kernel(input(a, [2, 8]));
134 assert.deepEqual(result.map(function(v) { return Array.from(v); }), [[1,3,5,7,9,11,13,15],[2,4,6,8,10,12,14,16]]);
135 gpu.destroy();
136}
137
138test("inputYXOffset auto", () => {
139 inputYXOffset();

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…