(mode)
| 39 | }); |
| 40 | |
| 41 | function outputMatrix(mode) { |
| 42 | const gpu = new GPU({ mode }); |
| 43 | const input = [ |
| 44 | [1,2,3,4,5], |
| 45 | [1,2,3,4,5], |
| 46 | [1,2,3,4,5], |
| 47 | [1,2,3,4,5], |
| 48 | [1,2,3,4,5], |
| 49 | ]; |
| 50 | const kernel = gpu.createKernel(function(input) { |
| 51 | return input[this.thread.y][this.thread.x]; |
| 52 | }, { output: [5, 5] }); |
| 53 | const result = kernel(input); |
| 54 | assert.deepEqual(result.map(array => Array.from(array)), input); |
| 55 | gpu.destroy(); |
| 56 | } |
| 57 | |
| 58 | test('output matrix auto', () => { |
| 59 | outputMatrix(); |
no test coverage detected
searching dependent graphs…