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

Function outputMatrix

test/features/output.js:41–56  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

39});
40
41function outputMatrix(mode) {
42 const gpu = new GPU({ mode });
43 const input = [
44 [1,2,3,4,5],
45 [1,2,3,4,5],
46 [1,2,3,4,5],
47 [1,2,3,4,5],
48 [1,2,3,4,5],
49 ];
50 const kernel = gpu.createKernel(function(input) {
51 return input[this.thread.y][this.thread.x];
52 }, { output: [5, 5] });
53 const result = kernel(input);
54 assert.deepEqual(result.map(array => Array.from(array)), input);
55 gpu.destroy();
56}
57
58test('output matrix auto', () => {
59 outputMatrix();

Callers 1

output.jsFile · 0.85

Calls 3

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…