-
Notifications
You must be signed in to change notification settings - Fork 664
/
Copy pathkernel.js
949 lines (854 loc) · 21.8 KB
/
kernel.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
const { utils } = require('../utils');
const { Input } = require('../input');
class Kernel {
/**
* @type {Boolean}
*/
static get isSupported() {
throw new Error(`"isSupported" not implemented on ${ this.name }`);
}
/**
* @abstract
* @returns {Boolean}
*/
static isContextMatch(context) {
throw new Error(`"isContextMatch" not implemented on ${ this.name }`);
}
/**
* @type {IKernelFeatures}
* Used internally to populate the kernel.feature, which is a getter for the output of this value
*/
static getFeatures() {
throw new Error(`"getFeatures" not implemented on ${ this.name }`);
}
static destroyContext(context) {
throw new Error(`"destroyContext" called on ${ this.name }`);
}
static nativeFunctionArguments() {
throw new Error(`"nativeFunctionArguments" called on ${ this.name }`);
}
static nativeFunctionReturnType() {
throw new Error(`"nativeFunctionReturnType" called on ${ this.name }`);
}
static combineKernels() {
throw new Error(`"combineKernels" called on ${ this.name }`);
}
/**
*
* @param {string|IKernelJSON} source
* @param [settings]
*/
constructor(source, settings) {
if (typeof source !== 'object') {
if (typeof source !== 'string') {
throw new Error('source not a string');
}
if (!utils.isFunctionString(source)) {
throw new Error('source not a function string');
}
}
this.useLegacyEncoder = false;
this.fallbackRequested = false;
this.onRequestFallback = null;
/**
* Name of the arguments found from parsing source argument
* @type {String[]}
*/
this.argumentNames = typeof source === 'string' ? utils.getArgumentNamesFromString(source) : null;
this.argumentTypes = null;
this.argumentSizes = null;
this.argumentBitRatios = null;
this.kernelArguments = null;
this.kernelConstants = null;
this.forceUploadKernelConstants = null;
/**
* The function source
* @type {String|IKernelJSON}
*/
this.source = source;
/**
* The size of the kernel's output
* @type {Number[]}
*/
this.output = null;
/**
* Debug mode
* @type {Boolean}
*/
this.debug = false;
/**
* Graphical mode
* @type {Boolean}
*/
this.graphical = false;
/**
* Maximum loops when using argument values to prevent infinity
* @type {Number}
*/
this.loopMaxIterations = 0;
/**
* Constants used in kernel via `this.constants`
* @type {Object}
*/
this.constants = null;
/**
*
* @type {Object.<string, string>}
*/
this.constantTypes = null;
/**
*
* @type {Object.<string, number>}
*/
this.constantBitRatios = null;
/**
*
* @type {boolean}
*/
this.dynamicArguments = false;
/**
*
* @type {boolean}
*/
this.dynamicOutput = false;
/**
*
* @type {Object}
*/
this.canvas = null;
/**
*
* @type {Object}
*/
this.context = null;
/**
*
* @type {Boolean}
*/
this.checkContext = null;
/**
*
* @type {GPU}
*/
this.gpu = null;
/**
*
* @type {IGPUFunction[]}
*/
this.functions = null;
/**
*
* @type {IGPUNativeFunction[]}
*/
this.nativeFunctions = null;
/**
*
* @type {String}
*/
this.injectedNative = null;
/**
*
* @type {ISubKernel[]}
*/
this.subKernels = null;
/**
*
* @type {Boolean}
*/
this.validate = true;
/**
* Enforces kernel to write to a new array or texture on run
* @type {Boolean}
*/
this.immutable = false;
/**
* Enforces kernel to write to a texture on run
* @type {Boolean}
*/
this.pipeline = false;
/**
* Make GPU use single precision or unsigned. Acceptable values: 'single' or 'unsigned'
* @type {String|null}
* @enum 'single' | 'unsigned'
*/
this.precision = null;
/**
*
* @type {String|null}
* @enum 'speed' | 'balanced' | 'precision'
*/
this.tactic = null;
this.plugins = null;
this.returnType = null;
this.leadingReturnStatement = null;
this.followingReturnStatement = null;
this.optimizeFloatMemory = null;
this.strictIntegers = false;
this.fixIntegerDivisionAccuracy = null;
this.built = false;
this.signature = null;
}
/**
*
* @param {IDirectKernelSettings|IJSONSettings} settings
*/
mergeSettings(settings) {
for (let p in settings) {
if (!settings.hasOwnProperty(p) || !this.hasOwnProperty(p)) continue;
switch (p) {
case 'output':
if (!Array.isArray(settings.output)) {
this.setOutput(settings.output); // Flatten output object
continue;
}
break;
case 'functions':
this.functions = [];
for (let i = 0; i < settings.functions.length; i++) {
this.addFunction(settings.functions[i]);
}
continue;
case 'graphical':
if (settings[p] && !settings.hasOwnProperty('precision')) {
this.precision = 'unsigned';
}
this[p] = settings[p];
continue;
case 'nativeFunctions':
if (!settings.nativeFunctions) continue;
this.nativeFunctions = [];
for (let i = 0; i < settings.nativeFunctions.length; i++) {
const s = settings.nativeFunctions[i];
const { name, source } = s;
this.addNativeFunction(name, source, s);
}
continue;
}
this[p] = settings[p];
}
if (!this.canvas) this.canvas = this.initCanvas();
if (!this.context) this.context = this.initContext();
if (!this.plugins) this.plugins = this.initPlugins(settings);
}
/**
* @desc Builds the Kernel, by compiling Fragment and Vertical Shaders,
* and instantiates the program.
* @abstract
*/
build() {
throw new Error(`"build" not defined on ${ this.constructor.name }`);
}
/**
* @desc Run the kernel program, and send the output to renderOutput
* <p> This method calls a helper method *renderOutput* to return the result. </p>
* @returns {Float32Array|Float32Array[]|Float32Array[][]|void} Result The final output of the program, as float, and as Textures for reuse.
* @abstract
*/
run() {
throw new Error(`"run" not defined on ${ this.constructor.name }`)
}
/**
* @abstract
* @return {Object}
*/
initCanvas() {
throw new Error(`"initCanvas" not defined on ${ this.constructor.name }`);
}
/**
* @abstract
* @return {Object}
*/
initContext() {
throw new Error(`"initContext" not defined on ${ this.constructor.name }`);
}
/**
* @param {IDirectKernelSettings} settings
* @return {string[]};
* @abstract
*/
initPlugins(settings) {
throw new Error(`"initPlugins" not defined on ${ this.constructor.name }`);
}
/**
*
* @param {KernelFunction|string|IGPUFunction} source
* @param {IFunctionSettings} [settings]
* @return {Kernel}
*/
addFunction(source, settings = {}) {
if (source.name && source.source && source.argumentTypes && 'returnType' in source) {
this.functions.push(source);
} else if (typeof source === 'string' || typeof source === 'function') {
this.functions.push(this.functionToIGPUFunction(source, settings));
} else if ('settings' in source && 'source' in source) {
this.functions.push(this.functionToIGPUFunction(source.source, source.settings));
} else {
throw new Error(`function not properly defined`);
}
return this;
}
/**
*
* @param {string} name
* @param {string} source
* @param {IGPUFunctionSettings} [settings]
*/
addNativeFunction(name, source, settings = {}) {
const { argumentTypes, argumentNames } = settings.argumentTypes ?
splitArgumentTypes(settings.argumentTypes) :
this.constructor.nativeFunctionArguments(source) || {};
this.nativeFunctions.push({
name,
source,
settings,
argumentTypes,
argumentNames,
returnType: settings.returnType || this.constructor.nativeFunctionReturnType(source)
});
return this;
}
/**
* @desc Setup the parameter types for the parameters
* supplied to the Kernel function
*
* @param {IArguments} args - The actual parameters sent to the Kernel
*/
setupArguments(args) {
this.kernelArguments = [];
if (!this.argumentTypes) {
if (!this.argumentTypes) {
this.argumentTypes = [];
for (let i = 0; i < args.length; i++) {
const argType = utils.getVariableType(args[i], this.strictIntegers);
const type = argType === 'Integer' ? 'Number' : argType;
this.argumentTypes.push(type);
this.kernelArguments.push({
type
});
}
}
} else {
for (let i = 0; i < this.argumentTypes.length; i++) {
this.kernelArguments.push({
type: this.argumentTypes[i]
});
}
}
// setup sizes
this.argumentSizes = new Array(args.length);
this.argumentBitRatios = new Int32Array(args.length);
for (let i = 0; i < args.length; i++) {
const arg = args[i];
this.argumentSizes[i] = arg.constructor === Input ? arg.size : null;
this.argumentBitRatios[i] = this.getBitRatio(arg);
}
if (this.argumentNames.length !== args.length) {
throw new Error(`arguments are miss-aligned`);
}
}
/**
* Setup constants
*/
setupConstants() {
this.kernelConstants = [];
let needsConstantTypes = this.constantTypes === null;
if (needsConstantTypes) {
this.constantTypes = {};
}
this.constantBitRatios = {};
if (this.constants) {
for (let name in this.constants) {
if (needsConstantTypes) {
const type = utils.getVariableType(this.constants[name], this.strictIntegers);
this.constantTypes[name] = type;
this.kernelConstants.push({
name,
type
});
} else {
this.kernelConstants.push({
name,
type: this.constantTypes[name]
});
}
this.constantBitRatios[name] = this.getBitRatio(this.constants[name]);
}
}
}
/**
*
* @param flag
* @return {this}
*/
setOptimizeFloatMemory(flag) {
this.optimizeFloatMemory = flag;
return this;
}
/**
*
* @param {Array|Object} output
* @return {number[]}
*/
toKernelOutput(output) {
if (output.hasOwnProperty('x')) {
if (output.hasOwnProperty('y')) {
if (output.hasOwnProperty('z')) {
return [output.x, output.y, output.z];
} else {
return [output.x, output.y];
}
} else {
return [output.x];
}
} else {
return output;
}
}
/**
* @desc Set output dimensions of the kernel function
* @param {Array|Object} output - The output array to set the kernel output size to
* @return {this}
*/
setOutput(output) {
this.output = this.toKernelOutput(output);
return this;
}
/**
* @desc Toggle debug mode
* @param {Boolean} flag - true to enable debug
* @return {this}
*/
setDebug(flag) {
this.debug = flag;
return this;
}
/**
* @desc Toggle graphical output mode
* @param {Boolean} flag - true to enable graphical output
* @return {this}
*/
setGraphical(flag) {
this.graphical = flag;
this.precision = 'unsigned';
return this;
}
/**
* @desc Set the maximum number of loop iterations
* @param {number} max - iterations count
* @return {this}
*/
setLoopMaxIterations(max) {
this.loopMaxIterations = max;
return this;
}
/**
* @desc Set Constants
* @return {this}
*/
setConstants(constants) {
this.constants = constants;
return this;
}
/**
*
* @param {IKernelValueTypes} constantTypes
* @return {this}
*/
setConstantTypes(constantTypes) {
this.constantTypes = constantTypes;
return this;
}
/**
*
* @param {IFunction[]|KernelFunction[]} functions
* @return {this}
*/
setFunctions(functions) {
for (let i = 0; i < functions.length; i++) {
this.addFunction(functions[i]);
}
return this;
}
/**
*
* @param {IGPUNativeFunction[]} nativeFunctions
* @return {this}
*/
setNativeFunctions(nativeFunctions) {
for (let i = 0; i < nativeFunctions.length; i++) {
const settings = nativeFunctions[i];
const { name, source } = settings;
this.addNativeFunction(name, source, settings);
}
return this;
}
/**
*
* @param {String} injectedNative
* @return {this}
*/
setInjectedNative(injectedNative) {
this.injectedNative = injectedNative;
return this;
}
/**
* Set writing to texture on/off
* @param flag
* @return {this}
*/
setPipeline(flag) {
this.pipeline = flag;
return this;
}
/**
* Set precision to 'unsigned' or 'single'
* @param {String} flag 'unsigned' or 'single'
* @return {this}
*/
setPrecision(flag) {
this.precision = flag;
return this;
}
/**
* @param flag
* @return {Kernel}
* @deprecated
*/
setDimensions(flag) {
utils.warnDeprecated('method', 'setDimensions', 'setOutput');
this.output = flag;
return this;
}
/**
* @param flag
* @return {this}
* @deprecated
*/
setOutputToTexture(flag) {
utils.warnDeprecated('method', 'setOutputToTexture', 'setPipeline');
this.pipeline = flag;
return this;
}
/**
* Set to immutable
* @param flag
* @return {this}
*/
setImmutable(flag) {
this.immutable = flag;
return this;
}
/**
* @desc Bind the canvas to kernel
* @param {Object} canvas
* @return {this}
*/
setCanvas(canvas) {
this.canvas = canvas;
return this;
}
/**
* @param {Boolean} flag
* @return {this}
*/
setStrictIntegers(flag) {
this.strictIntegers = flag;
return this;
}
/**
*
* @param flag
* @return {this}
*/
setDynamicOutput(flag) {
this.dynamicOutput = flag;
return this;
}
/**
* @deprecated
* @param flag
* @return {this}
*/
setHardcodeConstants(flag) {
utils.warnDeprecated('method', 'setHardcodeConstants');
this.setDynamicOutput(flag);
this.setDynamicArguments(flag);
return this;
}
/**
*
* @param flag
* @return {this}
*/
setDynamicArguments(flag) {
this.dynamicArguments = flag;
return this;
}
/**
* @param {Boolean} flag
* @return {this}
*/
setUseLegacyEncoder(flag) {
this.useLegacyEncoder = flag;
return this;
}
/**
*
* @param {Boolean} flag
* @return {this}
*/
setWarnVarUsage(flag) {
utils.warnDeprecated('method', 'setWarnVarUsage');
return this;
}
/**
* @deprecated
* @returns {Object}
*/
getCanvas() {
utils.warnDeprecated('method', 'getCanvas');
return this.canvas;
}
/**
* @deprecated
* @returns {Object}
*/
getWebGl() {
utils.warnDeprecated('method', 'getWebGl');
return this.context;
}
/**
* @desc Bind the webGL instance to kernel
* @param {WebGLRenderingContext} context - webGl instance to bind
*/
setContext(context) {
this.context = context;
return this;
}
/**
*
* @param {IKernelValueTypes|GPUVariableType[]} argumentTypes
* @return {this}
*/
setArgumentTypes(argumentTypes) {
if (Array.isArray(argumentTypes)) {
this.argumentTypes = argumentTypes;
} else {
this.argumentTypes = [];
for (const p in argumentTypes) {
if (!argumentTypes.hasOwnProperty(p)) continue;
const argumentIndex = this.argumentNames.indexOf(p);
if (argumentIndex === -1) throw new Error(`unable to find argument ${ p }`);
this.argumentTypes[argumentIndex] = argumentTypes[p];
}
}
return this;
}
/**
*
* @param {Tactic} tactic
* @return {this}
*/
setTactic(tactic) {
this.tactic = tactic;
return this;
}
requestFallback(args) {
if (!this.onRequestFallback) {
throw new Error(`"onRequestFallback" not defined on ${ this.constructor.name }`);
}
this.fallbackRequested = true;
return this.onRequestFallback(args);
}
/**
* @desc Validate settings
* @abstract
*/
validateSettings() {
throw new Error(`"validateSettings" not defined on ${ this.constructor.name }`);
}
/**
* @desc Add a sub kernel to the root kernel instance.
* This is what `createKernelMap` uses.
*
* @param {ISubKernel} subKernel - function (as a String) of the subKernel to add
*/
addSubKernel(subKernel) {
if (this.subKernels === null) {
this.subKernels = [];
}
if (!subKernel.source) throw new Error('subKernel missing "source" property');
if (!subKernel.property && isNaN(subKernel.property)) throw new Error('subKernel missing "property" property');
if (!subKernel.name) throw new Error('subKernel missing "name" property');
this.subKernels.push(subKernel);
return this;
}
/**
* @desc Destroys all memory associated with this kernel
* @param {Boolean} [removeCanvasReferences] remove any associated canvas references
*/
destroy(removeCanvasReferences) {
throw new Error(`"destroy" called on ${ this.constructor.name }`);
}
/**
* bit storage ratio of source to target 'buffer', i.e. if 8bit array -> 32bit tex = 4
* @param value
* @returns {number}
*/
getBitRatio(value) {
if (this.precision === 'single') {
// 8 and 16 are up-converted to float32
return 4;
} else if (Array.isArray(value[0])) {
return this.getBitRatio(value[0]);
} else if (value.constructor === Input) {
return this.getBitRatio(value.value);
}
switch (value.constructor) {
case Uint8ClampedArray:
case Uint8Array:
case Int8Array:
return 1;
case Uint16Array:
case Int16Array:
return 2;
case Float32Array:
case Int32Array:
default:
return 4;
}
}
/**
* @param {Boolean} [flip]
* @returns {Uint8ClampedArray}
*/
getPixels(flip) {
throw new Error(`"getPixels" called on ${ this.constructor.name }`);
}
checkOutput() {
if (!this.output || !utils.isArray(this.output)) throw new Error('kernel.output not an array');
if (this.output.length < 1) throw new Error('kernel.output is empty, needs at least 1 value');
for (let i = 0; i < this.output.length; i++) {
if (isNaN(this.output[i]) || this.output[i] < 1) {
throw new Error(`${ this.constructor.name }.output[${ i }] incorrectly defined as \`${ this.output[i] }\`, needs to be numeric, and greater than 0`);
}
}
}
/**
*
* @param {String} value
*/
prependString(value) {
throw new Error(`"prependString" called on ${ this.constructor.name }`);
}
/**
*
* @param {String} value
* @return Boolean
*/
hasPrependString(value) {
throw new Error(`"hasPrependString" called on ${ this.constructor.name }`);
}
/**
* @return {IKernelJSON}
*/
toJSON() {
return {
settings: {
output: this.output,
pipeline: this.pipeline,
argumentNames: this.argumentNames,
argumentsTypes: this.argumentTypes,
constants: this.constants,
pluginNames: this.plugins ? this.plugins.map(plugin => plugin.name) : null,
returnType: this.returnType,
}
};
}
/**
* @param {IArguments} args
*/
buildSignature(args) {
const Constructor = this.constructor;
this.signature = Constructor.getSignature(this, Constructor.getArgumentTypes(this, args));
}
/**
* @param {Kernel} kernel
* @param {IArguments} args
* @returns GPUVariableType[]
*/
static getArgumentTypes(kernel, args) {
const argumentTypes = new Array(args.length);
for (let i = 0; i < args.length; i++) {
const arg = args[i];
const type = kernel.argumentTypes[i];
if (arg.type) {
argumentTypes[i] = arg.type;
} else {
switch (type) {
case 'Number':
case 'Integer':
case 'Float':
case 'ArrayTexture(1)':
argumentTypes[i] = utils.getVariableType(arg);
break;
default:
argumentTypes[i] = type;
}
}
}
return argumentTypes;
}
/**
*
* @param {Kernel} kernel
* @param {GPUVariableType[]} argumentTypes
* @abstract
*/
static getSignature(kernel, argumentTypes) {
throw new Error(`"getSignature" not implemented on ${ this.name }`);
}
/**
*
* @param {String|Function} source
* @param {IFunctionSettings} [settings]
* @returns {IGPUFunction}
*/
functionToIGPUFunction(source, settings = {}) {
if (typeof source !== 'string' && typeof source !== 'function') throw new Error('source not a string or function');
const sourceString = typeof source === 'string' ? source : source.toString();
let argumentTypes = [];
if (Array.isArray(settings.argumentTypes)) {
argumentTypes = settings.argumentTypes;
} else if (typeof settings.argumentTypes === 'object') {
argumentTypes = utils.getArgumentNamesFromString(sourceString)
.map(name => settings.argumentTypes[name]) || [];
} else {
argumentTypes = settings.argumentTypes || [];
}
return {
name: utils.getFunctionNameFromString(sourceString) || null,
source: sourceString,
argumentTypes,
returnType: settings.returnType || null,
};
}
/**
*
* @param {Kernel} previousKernel
* @abstract
*/
onActivate(previousKernel) {}
}
function splitArgumentTypes(argumentTypesObject) {
const argumentNames = Object.keys(argumentTypesObject);
const argumentTypes = [];
for (let i = 0; i < argumentNames.length; i++) {
const argumentName = argumentNames[i];
argumentTypes.push(argumentTypesObject[argumentName]);
}
return { argumentTypes, argumentNames };
}
module.exports = {
Kernel
};