MCPcopy Create free account
hub / github.com/gpujs/gpu.js / testSameSourceDestinationFromResultThrows

Function testSameSourceDestinationFromResultThrows

test/internal/recycling.js:627–641  ·  view source on GitHub ↗
(error, precision, mode)

Source from the content-addressed store, hash-verified

625});
626
627function testSameSourceDestinationFromResultThrows(error, precision, mode) {
628 const gpu = new GPU({ mode });
629 const kernel = gpu.createKernel(function(value) {
630 return value[this.thread.x] + 1;
631 }, {
632 output: [1],
633 pipeline: true,
634 immutable: false,
635 precision,
636 });
637 let result = kernel([0]);
638 assert.equal((result.toArray ? result.toArray() : result)[0], 1);
639 assert.throws(() => kernel(result), error);
640 gpu.destroy();
641}
642
643const gpuError = new Error('Source and destination textures are the same. Use immutable = true and manually cleanup kernel output texture memory with texture.delete()');
644const cpuError = new Error('Source and destination arrays are the same. Use immutable = true');

Callers 1

recycling.jsFile · 0.85

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…