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

Function testBooleanHandled

test/issues/564-boolean.js:6–20  ·  view source on GitHub ↗
(fft, mode)

Source from the content-addressed store, hash-verified

4describe('issue #564 - boolean handled');
5
6function testBooleanHandled(fft, mode) {
7 const gpu = new GPU({ mode });
8 gpu.addNativeFunction('fft', fft, { returnType: 'Array(4)' });
9 const kernel = gpu.createKernel(
10 function(){
11 let s = true;
12 return fft(s);
13 },{
14 output:[1],
15 }
16 );
17 assert.deepEqual(Array.from(kernel()[0]), [1,1,1,1]);
18
19 gpu.destroy();
20}
21
22const fft = `vec4 fft (bool horizontal){
23 return vec4(1,1,horizontal?1:0,1);

Callers 1

564-boolean.jsFile · 0.85

Calls 4

addNativeFunctionMethod · 0.95
createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…