(error, precision, mode)
| 692 | }); |
| 693 | |
| 694 | function testSameSourceDestinationFromMappedResultThrows(error, precision, mode) { |
| 695 | const gpu = new GPU({ mode }); |
| 696 | const kernel = gpu.createKernelMap({ |
| 697 | mappedResult: function map(v) { |
| 698 | return v; |
| 699 | } |
| 700 | }, function(value) { |
| 701 | return map(value[this.thread.x] + 1); |
| 702 | }, { |
| 703 | output: [1], |
| 704 | pipeline: true, |
| 705 | immutable: false, |
| 706 | precision, |
| 707 | }); |
| 708 | let { result, mappedResult } = kernel([0]); |
| 709 | assert.equal((mappedResult.toArray ? mappedResult.toArray() : mappedResult)[0], 1); |
| 710 | assert.throws(() => kernel(mappedResult), error); |
| 711 | assert.throws(() => kernel(result), error); |
| 712 | gpu.destroy(); |
| 713 | } |
| 714 | |
| 715 | test('single precision same source and destination from mapped result mutable throws auto', () => { |
| 716 | testSameSourceDestinationFromMappedResultThrows(gpuError, 'single'); |
no test coverage detected
searching dependent graphs…