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

Function createKernelMapArray3

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

Source from the content-addressed store, hash-verified

288});
289
290function createKernelMapArray3(mode) {
291 const gpu = new GPU({ mode });
292 const kernel = gpu.createKernelMap(
293 {
294 mapFunc: function mapFunc(mapFuncVal) {
295 return mapFuncVal;
296 }
297 },
298 function main() {
299 const mapFuncVal = [1, 2, 3];
300 mapFunc(mapFuncVal);
301 const returnValue = [4, 5, 6];
302 return returnValue;
303 },
304 {
305 output: [1],
306 returnType: 'Array(3)',
307 }
308 );
309 const { result, mapFunc } = kernel();
310 assert.deepEqual(Array.from(mapFunc[0]), [1, 2, 3]);
311 assert.deepEqual(Array.from(result[0]), [4, 5, 6]);
312 gpu.destroy();
313}
314
315test('createKernelMap Array(3) auto', () => {
316 createKernelMapArray3();

Callers 1

Calls 3

createKernelMapMethod · 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…