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

Function oneLayerDeepFloat

test/internal/deep-types.js:7–26  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

5describe('internal: deep types');
6
7function oneLayerDeepFloat(mode) {
8 const gpu = new GPU({ mode });
9 function childFunction(childFunctionArgument1) {
10 return childFunctionArgument1 + 1;
11 }
12 gpu.addFunction(childFunction);
13
14 const kernel = gpu.createKernel(function(kernelArgument1) {
15 return childFunction(kernelArgument1);
16 }, { output: [1] });
17 sinon.spy(FunctionBuilder.prototype, 'lookupReturnType');
18 try {
19 const result = kernel(1.5);
20 assert.equal(result[0], 2.5);
21 assert.equal(FunctionBuilder.prototype.lookupReturnType.callCount, 1);
22 assert.equal(FunctionBuilder.prototype.lookupReturnType.args[0][0], 'childFunction');
23 } finally {
24 FunctionBuilder.prototype.lookupReturnType.restore();
25 }
26}
27
28(GPU.isWebGLSupported ? test : skip)('one layer deep float WebGL', () => {
29 oneLayerDeepFloat('webgl');

Callers 1

deep-types.jsFile · 0.85

Calls 4

addFunctionMethod · 0.95
createKernelMethod · 0.95
childFunctionFunction · 0.85
kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…