(mode)
| 80 | }); |
| 81 | |
| 82 | function outputCube(mode) { |
| 83 | const gpu = new GPU({ mode }); |
| 84 | const input = [ |
| 85 | [ |
| 86 | [1,2,3,4,5], |
| 87 | [1,2,3,4,5], |
| 88 | [1,2,3,4,5], |
| 89 | [1,2,3,4,5], |
| 90 | [1,2,3,4,5], |
| 91 | ], |
| 92 | [ |
| 93 | [1,2,3,4,5], |
| 94 | [1,2,3,4,5], |
| 95 | [1,2,3,4,5], |
| 96 | [1,2,3,4,5], |
| 97 | [1,2,3,4,5], |
| 98 | ], |
| 99 | [ |
| 100 | [1,2,3,4,5], |
| 101 | [1,2,3,4,5], |
| 102 | [1,2,3,4,5], |
| 103 | [1,2,3,4,5], |
| 104 | [1,2,3,4,5], |
| 105 | ], |
| 106 | [ |
| 107 | [1,2,3,4,5], |
| 108 | [1,2,3,4,5], |
| 109 | [1,2,3,4,5], |
| 110 | [1,2,3,4,5], |
| 111 | [1,2,3,4,5], |
| 112 | ], |
| 113 | [ |
| 114 | [1,2,3,4,5], |
| 115 | [1,2,3,4,5], |
| 116 | [1,2,3,4,5], |
| 117 | [1,2,3,4,5], |
| 118 | [1,2,3,4,5], |
| 119 | ] |
| 120 | ]; |
| 121 | const kernel = gpu.createKernel(function(input) { |
| 122 | return input[this.thread.z][this.thread.y][this.thread.x]; |
| 123 | }, { output: [5, 5, 5] }); |
| 124 | const result = kernel(input); |
| 125 | assert.deepEqual(result.map(matrix => matrix.map(array => Array.from(array))), input); |
| 126 | gpu.destroy(); |
| 127 | } |
| 128 | |
| 129 | test('output cube auto', () => { |
| 130 | outputCube(); |
no test coverage detected
searching dependent graphs…