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

Function toString

test/issues/263-to-string.js:6–19  ·  view source on GitHub ↗
(mode, context, canvas)

Source from the content-addressed store, hash-verified

4describe('issue #263');
5
6function toString(mode, context, canvas) {
7 const gpu = new GPU({ mode, context, canvas });
8 const kernel = gpu.createKernel(function() {
9 return 1;
10 }, {
11 output: [1]
12 });
13 kernel.build();
14 const string = kernel.toString();
15 const kernel2 = new Function('return ' + string)()({ context, canvas });
16 const result = kernel2();
17 assert.equal(result[0], 1);
18 gpu.destroy();
19}
20
21(GPU.isWebGLSupported ? test : skip)('Issue #263 toString single function - webgl', () => {
22 const canvas = document.createElement('canvas');

Callers 1

263-to-string.jsFile · 0.85

Calls 4

createKernelMethod · 0.95
destroyMethod · 0.95
buildMethod · 0.45
toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…