(error, precision, mode)
| 625 | }); |
| 626 | |
| 627 | function 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 | |
| 643 | const gpuError = new Error('Source and destination textures are the same. Use immutable = true and manually cleanup kernel output texture memory with texture.delete()'); |
| 644 | const cpuError = new Error('Source and destination arrays are the same. Use immutable = true'); |
no test coverage detected
searching dependent graphs…