(mode)
| 590 | |
| 591 | |
| 592 | function notDefined(mode) { |
| 593 | const gpu = new GPU({ mode }); |
| 594 | const kernel1 = gpu.createKernel(function() { |
| 595 | return result; |
| 596 | }, { output: [1] }); |
| 597 | assert.throws(() => { |
| 598 | kernel1(); |
| 599 | }, new Error('Identifier is not defined on line 1, position 0:\n result')); |
| 600 | const kernel2 = gpu.createKernel(function() { |
| 601 | return result[0]; |
| 602 | }, { output: [1] }); |
| 603 | assert.throws(() => { |
| 604 | kernel2(); |
| 605 | }, new Error('Identifier is not defined on line 1, position 0:\n result')); |
| 606 | const kernel3 = gpu.createKernel(function() { |
| 607 | return result[0][0]; |
| 608 | }, { output: [1] }); |
| 609 | assert.throws(() => { |
| 610 | kernel3(); |
| 611 | }, new Error('Identifier is not defined on line 1, position 0:\n result')); |
| 612 | const kernel4 = gpu.createKernel(function() { |
| 613 | return result[0][0][0]; |
| 614 | }, { output: [1] }); |
| 615 | assert.throws(() => { |
| 616 | kernel4(); |
| 617 | }, new Error('Identifier is not defined on line 1, position 0:\n result')); |
| 618 | const kernel5 = gpu.createKernel(function() { |
| 619 | return result[0][0][0][0]; |
| 620 | }, { output: [1] }); |
| 621 | assert.throws(() => { |
| 622 | kernel5(); |
| 623 | }, new Error('Identifier is not defined on line 1, position 1:\n result')); |
| 624 | gpu.destroy(); |
| 625 | } |
| 626 | |
| 627 | test('not defined auto', () => { |
| 628 | notDefined(); |
no test coverage detected
searching dependent graphs…