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

Function testModKernel

test/issues/382-bad-constant.js:6–21  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

4describe('issue #382');
5
6function testModKernel(mode) {
7 const gpu = new GPU({ mode: mode });
8 const conflictingName = 0.4;
9 const kernel = gpu.createKernel(function(a, conflictingName) {
10 return a[this.thread.x] + this.constants.conflictingName + conflictingName;
11 })
12 .setOutput([1])
13 .setConstants({
14 conflictingName: conflictingName
15 });
16
17 const result = kernel([1], 0.6);
18
19 assert.equal(result[0], 2);
20 gpu.destroy();
21}
22
23(GPU.isWebGLSupported ? test : skip)('Issue #382 - bad constant webgl', () => {
24 testModKernel('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…