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

Function singlePrecision

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

Source from the content-addressed store, hash-verified

83});
84
85function singlePrecision(mode) {
86 const gpu = new GPU({ mode });
87 const array = [1,2,3,4,5];
88 const kernel = gpu.createKernel(function(array) {
89 return array[this.thread.x];
90 }, {
91 output: [5],
92 optimizeFloatMemory: true,
93 precision: 'single',
94 });
95 const result = kernel(array);
96 assert.deepEqual(Array.from(result), array);
97 gpu.destroy();
98}
99
100(GPU.isSinglePrecisionSupported && GPU.isGPUSupported ? test : skip)('single precision auto', () => {
101 singlePrecision();

Callers 1

Calls 3

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…