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

Function threeLayerTemplate

test/internal/function-builder.js:7–41  ·  view source on GitHub ↗
(FunctionNode)

Source from the content-addressed store, hash-verified

5
6// Three layer template for multiple tests
7function threeLayerTemplate(FunctionNode) {
8 function layerOne() {
9 return 42;
10 }
11
12 function layerTwo() {
13 return layerOne() * 2;
14 }
15
16 function layerThree() {
17 return layerTwo() * 2;
18 }
19
20 // Create a function hello node
21 return new FunctionBuilder({
22 functionNodes: [
23 new FunctionNode(layerOne.toString(), {
24 output: [1],
25 lookupReturnType: () => 'Number',
26 lookupFunctionArgumentTypes: () => {}
27 }),
28 new FunctionNode(layerTwo.toString(), {
29 output: [1],
30 lookupReturnType: () => 'Number',
31 lookupFunctionArgumentTypes: () => {}
32 }),
33 new FunctionNode(layerThree.toString(), {
34 output: [1],
35 lookupReturnType: () => 'Number',
36 lookupFunctionArgumentTypes: () => {}
37 }),
38 ],
39 output: [1]
40 });
41}
42
43/// Test the function tracing of 3 layers
44test('traceFunctionCalls: 3 layer test cpu', () => {

Callers 1

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…