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

Function floatPipeline2DOutput

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

Source from the content-addressed store, hash-verified

250
251
252function floatPipeline2DOutput(mode) {
253 const gpu = new GPU({ mode });
254 const matrix = [
255 [1,2,3,4,5],
256 [6,7,8,9,10],
257 [11,12,13,14,15],
258 ];
259 const kernel = gpu.createKernel(function(matrix) {
260 return matrix[this.thread.y][this.thread.x];
261 }, {
262 output: [5, 3],
263 optimizeFloatMemory: true,
264 precision: 'single',
265 pipeline: true,
266 });
267 const texture = kernel(matrix);
268 const result = texture.toArray();
269 assert.deepEqual(result.map(row => Array.from(row)), matrix);
270 gpu.destroy();
271}
272
273
274(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('float pipeline 2d 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…