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

Function createKernelMapArray2

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

Source from the content-addressed store, hash-verified

239});
240
241function createKernelMapArray2(mode) {
242 const gpu = new GPU({ mode });
243 const kernel = gpu.createKernelMap(
244 {
245 mapFunc: function mapFunc(mapFuncVal) {
246 return mapFuncVal;
247 }
248 },
249 function main() {
250 const mapFuncVal = [1, 2];
251 mapFunc(mapFuncVal);
252 const returnValue = [3, 4];
253 return returnValue;
254 },
255 {
256 output: [1],
257 returnType: 'Array(2)',
258 }
259 );
260 const { result, mapFunc } = kernel();
261 assert.deepEqual(Array.from(mapFunc[0]), [1, 2]);
262 assert.deepEqual(Array.from(result[0]), [3, 4]);
263 gpu.destroy();
264}
265
266test('createKernelMap Array(2) auto', () => {
267 createKernelMapArray2();

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…