(mode)
| 4 | describe('input'); |
| 5 | |
| 6 | function inputX(mode) { |
| 7 | const gpu = new GPU({ mode }); |
| 8 | const kernel = gpu.createKernel(function(a) { |
| 9 | return a[this.thread.x]; |
| 10 | }) |
| 11 | .setOutput([9]); |
| 12 | |
| 13 | const a = new Float32Array(9); |
| 14 | a.set([1,2,3,4,5,6,7,8,9]); |
| 15 | |
| 16 | const result = kernel(input(a, [3, 3])); |
| 17 | assert.deepEqual(Array.from(result), [1,2,3,4,5,6,7,8,9]); |
| 18 | gpu.destroy(); |
| 19 | } |
| 20 | |
| 21 | test("inputX auto", () => { |
| 22 | inputX(); |