* @desc Adds additional native functions, that the kernel may call. * @param {String} name - native function name, used for reverse lookup * @param {String} source - the native function implementation, as it would be defined in it's entirety * @param {object} [settings] * @returns {GPU}
(name, source, settings)
| 517 | * @returns {GPU} returns itself |
| 518 | */ |
| 519 | addNativeFunction(name, source, settings) { |
| 520 | if (this.kernels.length > 0) { |
| 521 | throw new Error('Cannot call "addNativeFunction" after "createKernels" has been called.'); |
| 522 | } |
| 523 | this.nativeFunctions.push(Object.assign({ name, source }, settings)); |
| 524 | return this; |
| 525 | } |
| 526 | |
| 527 | /** |
| 528 | * Inject a string just before translated kernel functions |
no outgoing calls
no test coverage detected