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

Function testOnlyFirstIterationSafari

test/issues/378-only-first-iteration.js:6–25  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

4describe('issue #378');
5
6function testOnlyFirstIterationSafari(mode) {
7 const gpu = new GPU({ mode: mode });
8 const conflictingName = 0.4;
9 const kernel = gpu.createKernel(function(iter) {
10 let sum = 0;
11 for(let i=2; i<iter; i++) {
12 sum = sum + i;
13 }
14 return 2*sum ; //+ this.thread.x;
15 })
16 .setOutput([10])
17 .setConstants({
18 conflictingName: conflictingName
19 });
20
21 const result = kernel(5);
22
23 assert.deepEqual(Array.from(result), [18,18,18,18,18,18,18,18,18,18]);
24 gpu.destroy();
25}
26
27(GPU.isWebGLSupported ? test : skip)('Issue #378 - only first iteration safari webgl', () => {
28 testOnlyFirstIterationSafari('webgl');

Callers 1

Calls 5

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
setConstantsMethod · 0.80
setOutputMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…