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

Function floatPipeline3DOutput

test/features/optimize-float-memory.js:291–316  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

289
290
291function floatPipeline3DOutput(mode) {
292 const gpu = new GPU({ mode });
293 const cube = [
294 [
295 [1,2,3,4,5],
296 [6,7,8,9,10],
297 [11,12,13,14,15],
298 ],
299 [
300 [16,17,18,19,20],
301 [21,22,23,24,25],
302 [26,27,28,29,30],
303 ]
304 ];
305 const kernel = gpu.createKernel(function(cube) {
306 return cube[this.thread.z][this.thread.y][this.thread.x];
307 }, {
308 output: [5, 3, 2],
309 optimizeFloatMemory: true,
310 precision: 'single',
311 pipeline: true,
312 });
313 const result = kernel(cube).toArray();
314 assert.deepEqual(result.map(matrix => matrix.map(row => Array.from(row))), cube);
315 gpu.destroy();
316}
317
318
319(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 3d output gpu (GPU only)', () => {

Callers 1

Calls 4

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
toArrayMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…