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

Function inputYXOffsetPlus1

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

Source from the content-addressed store, hash-verified

160});
161
162function inputYXOffsetPlus1(mode) {
163 const gpu = new GPU({ mode });
164 const kernel = gpu.createKernel(function(a) {
165 return a[this.thread.x][this.thread.y];
166 })
167 .setOutput([2, 8]);
168
169 const a = new Float32Array([1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16]);
170
171 const result = kernel(input(a, [8, 2]));
172 assert.deepEqual(result.map(function(v) { return Array.from(v); }), [[1,9],[2,10],[3,11],[4,12],[5,13],[6,14],[7,15],[8,16]]);
173 gpu.destroy();
174}
175
176test("inputYXOffsetPlus1 auto", () => {
177 inputYXOffsetPlus1();

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…