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

Function offOnOff

test/internal/mixed-memory-optimize.js:26–37  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

24}
25
26function offOnOff(mode) {
27 const gpu = new GPU({ mode });
28 const offKernel = getOffKernel(gpu);
29 const onKernel = getOnKernel(gpu);
30 const value = [1,2,3,4,5,6,7,8,9,10];
31 const textureResult = offKernel(value);
32 assert.deepEqual(Array.from(textureResult.toArray()), value);
33 assert.deepEqual(Array.from(onKernel(offKernel(value)).toArray()), value);
34 const result = offKernel(onKernel(offKernel(value))).toArray();
35 assert.deepEqual(Array.from(result), value);
36 gpu.destroy();
37}
38
39(GPU.isSinglePrecisionSupported ? test : skip)('off on off auto', () => {
40 offOnOff();

Callers 1

Calls 4

destroyMethod · 0.95
getOffKernelFunction · 0.85
getOnKernelFunction · 0.85
toArrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…