(mode)
| 239 | }); |
| 240 | |
| 241 | function createKernelMapArray2(mode) { |
| 242 | const gpu = new GPU({ mode }); |
| 243 | const kernel = gpu.createKernelMap( |
| 244 | { |
| 245 | mapFunc: function mapFunc(mapFuncVal) { |
| 246 | return mapFuncVal; |
| 247 | } |
| 248 | }, |
| 249 | function main() { |
| 250 | const mapFuncVal = [1, 2]; |
| 251 | mapFunc(mapFuncVal); |
| 252 | const returnValue = [3, 4]; |
| 253 | return returnValue; |
| 254 | }, |
| 255 | { |
| 256 | output: [1], |
| 257 | returnType: 'Array(2)', |
| 258 | } |
| 259 | ); |
| 260 | const { result, mapFunc } = kernel(); |
| 261 | assert.deepEqual(Array.from(mapFunc[0]), [1, 2]); |
| 262 | assert.deepEqual(Array.from(result[0]), [3, 4]); |
| 263 | gpu.destroy(); |
| 264 | } |
| 265 | |
| 266 | test('createKernelMap Array(2) auto', () => { |
| 267 | createKernelMapArray2(); |
no test coverage detected
searching dependent graphs…