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

Function createKernelMapArray4

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

Source from the content-addressed store, hash-verified

337});
338
339function createKernelMapArray4(mode) {
340 const gpu = new GPU({ mode });
341 const kernel = gpu.createKernelMap(
342 {
343 mapFunc: function mapFunc(mapFuncVal) {
344 return mapFuncVal;
345 }
346 },
347 function main() {
348 const mapFuncVal = [1, 2, 3, 4];
349 mapFunc(mapFuncVal);
350 const returnValue = [5, 6, 7, 8];
351 return returnValue;
352 },
353 {
354 output: [1],
355 returnType: 'Array(4)',
356 }
357 );
358 const { result, mapFunc } = kernel();
359 assert.deepEqual(Array.from(mapFunc[0]), [1, 2, 3, 4]);
360 assert.deepEqual(Array.from(result[0]), [5, 6, 7, 8]);
361 gpu.destroy();
362}
363
364test('createKernelMap Array(4) auto', () => {
365 createKernelMapArray4();

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…