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

Function createKernelMapArrayAuto

test/features/create-kernel-map.js:158–170  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

156
157
158function createKernelMapArrayAuto(mode) {
159 const gpu = new GPU({mode});
160 const superKernel = createArrayKernels(gpu, [5]);
161 const kernel = createKernel(gpu, [5]);
162 const output = superKernel([1,2,3,4,5], [1,2,3,4,5], [1,2,3,4,5]);
163 const result = Array.from(output.result);
164 const addResult = Array.from(kernel(output[0]));
165 const divideResult = Array.from(kernel(output[1]));
166 assert.deepEqual(result, [2, 2, 2, 2, 2]);
167 assert.deepEqual(addResult, [2, 4, 6, 8, 10]);
168 assert.deepEqual(divideResult, [2, 2, 2, 2, 2]);
169 gpu.destroy();
170}
171(GPU.isKernelMapSupported ? test : skip)('createKernelMap array auto', () => {
172 createKernelMapArrayAuto();
173});

Callers 1

Calls 4

destroyMethod · 0.95
createArrayKernelsFunction · 0.85
createKernelFunction · 0.85
kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…