(mode)
| 337 | }); |
| 338 | |
| 339 | function createKernelMapArray4(mode) { |
| 340 | const gpu = new GPU({ mode }); |
| 341 | const kernel = gpu.createKernelMap( |
| 342 | { |
| 343 | mapFunc: function mapFunc(mapFuncVal) { |
| 344 | return mapFuncVal; |
| 345 | } |
| 346 | }, |
| 347 | function main() { |
| 348 | const mapFuncVal = [1, 2, 3, 4]; |
| 349 | mapFunc(mapFuncVal); |
| 350 | const returnValue = [5, 6, 7, 8]; |
| 351 | return returnValue; |
| 352 | }, |
| 353 | { |
| 354 | output: [1], |
| 355 | returnType: 'Array(4)', |
| 356 | } |
| 357 | ); |
| 358 | const { result, mapFunc } = kernel(); |
| 359 | assert.deepEqual(Array.from(mapFunc[0]), [1, 2, 3, 4]); |
| 360 | assert.deepEqual(Array.from(result[0]), [5, 6, 7, 8]); |
| 361 | gpu.destroy(); |
| 362 | } |
| 363 | |
| 364 | test('createKernelMap Array(4) auto', () => { |
| 365 | createKernelMapArray4(); |
no test coverage detected
searching dependent graphs…