MCPcopy Create free account
hub / github.com/gpujs/gpu.js / notDefined

Function notDefined

test/features/type-management.js:592–625  ·  view source on GitHub ↗
(mode)

Source from the content-addressed store, hash-verified

590
591
592function 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
627test('not defined auto', () => {
628 notDefined();

Callers 1

type-management.jsFile · 0.85

Calls 2

createKernelMethod · 0.95
destroyMethod · 0.95

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…