(mode)
| 288 | }); |
| 289 | |
| 290 | function createKernelMapArray3(mode) { |
| 291 | const gpu = new GPU({ mode }); |
| 292 | const kernel = gpu.createKernelMap( |
| 293 | { |
| 294 | mapFunc: function mapFunc(mapFuncVal) { |
| 295 | return mapFuncVal; |
| 296 | } |
| 297 | }, |
| 298 | function main() { |
| 299 | const mapFuncVal = [1, 2, 3]; |
| 300 | mapFunc(mapFuncVal); |
| 301 | const returnValue = [4, 5, 6]; |
| 302 | return returnValue; |
| 303 | }, |
| 304 | { |
| 305 | output: [1], |
| 306 | returnType: 'Array(3)', |
| 307 | } |
| 308 | ); |
| 309 | const { result, mapFunc } = kernel(); |
| 310 | assert.deepEqual(Array.from(mapFunc[0]), [1, 2, 3]); |
| 311 | assert.deepEqual(Array.from(result[0]), [4, 5, 6]); |
| 312 | gpu.destroy(); |
| 313 | } |
| 314 | |
| 315 | test('createKernelMap Array(3) auto', () => { |
| 316 | createKernelMapArray3(); |
no test coverage detected
searching dependent graphs…