MCPcopy Index your code
hub / github.com/gpujs/gpu.js / addNativeFunction

Method addNativeFunction

src/gpu.js:519–525  ·  view source on GitHub ↗

* @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)

Source from the content-addressed store, hash-verified

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

Callers 8

nativeDivideFunction · 0.95
mathRandomUniqueFunction · 0.95
testBooleanHandledFunction · 0.95
constructorMethod · 0.95
gpuAddABFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected