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

Function testUnsignedPrecisionArray

test/features/dynamic-arguments.js:949–967  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

947});
948
949function testUnsignedPrecisionArray(mode) {
950 const gpu = new GPU({ mode });
951 const kernel = gpu.createKernel(function(input) {
952 return input[this.thread.x];
953 })
954 .setPrecision('unsigned')
955 .setDynamicArguments(true)
956 .setDynamicOutput(true)
957 .setOutput([5]);
958
959 assert.deepEqual(kernel([1,2,3,4,5]), new Float32Array([1,2,3,4,5]));
960 kernel.setOutput([4]);
961 assert.deepEqual(kernel([1,2,3,4]), new Float32Array([1,2,3,4]));
962 kernel.setOutput([3]);
963 assert.deepEqual(kernel([1,2,3]), new Float32Array([1,2,3]));
964 kernel.setOutput([2]);
965 assert.deepEqual(kernel([1,2]), new Float32Array([1,2]));
966 gpu.destroy();
967}
968
969test('unsigned precision Array auto', () => {
970 testUnsignedPrecisionArray();

Callers 1

Calls 7

createKernelMethod · 0.95
destroyMethod · 0.95
kernelFunction · 0.85
setDynamicOutputMethod · 0.80
setDynamicArgumentsMethod · 0.80
setOutputMethod · 0.45
setPrecisionMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…