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

Function handleCastingFloat

test/internal/casting.js:121–139  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

119});
120
121function handleCastingFloat(mode) {
122 const gpu = new GPU({ mode });
123 function add(value1, value2) {
124 return value1 + value2;
125 }
126 gpu.addFunction(add, {
127 argumentTypes: ['Float', 'Float'],
128 returnType: 'Float'
129 });
130 const kernel = gpu.createKernel(function(value1, value2) {
131 return add(value1, value2);
132 }, {
133 output: [1],
134 argumentTypes: ['Integer', 'Integer'],
135 });
136 const result = kernel(1, 2);
137 assert.equal(result[0], 3);
138 gpu.destroy();
139}
140
141(GPU.isWebGLSupported ? test : skip)('handle casting float webgl', () => {
142 handleCastingFloat('webgl');

Callers 1

casting.jsFile · 0.85

Calls 5

addFunctionMethod · 0.95
createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
addFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…