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

Function testSubKernelsLegacyEncoderOn

test/features/legacy-encoder.js:104–122  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

102});
103
104function testSubKernelsLegacyEncoderOn(mode) {
105 const gpu = new GPU({ mode });
106 function addOne(value) {
107 return value + 1;
108 }
109 const kernel = gpu.createKernelMap([
110 addOne,
111 ], function() {
112 const value = addOne(1);
113 return value + 1;
114 }, {
115 output: [1],
116 precision: 'unsigned',
117 useLegacyEncoder: true,
118 });
119 assert.equal(kernel()[0][0], 2);
120 assert.equal(kernel().result[0], 3);
121 gpu.destroy();
122}
123
124(GPU.isKernelMapSupported ? test : skip)('subKernels on auto', () => {
125 testSubKernelsLegacyEncoderOn();

Callers 1

legacy-encoder.jsFile · 0.85

Calls 4

createKernelMapMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
addOneFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…