MCPcopy Create free account
hub / github.com/apache/tvm / wrapAsyncifyPackedFunc

Method wrapAsyncifyPackedFunc

web/src/runtime.ts:1772–1777  ·  view source on GitHub ↗

* Wrap a function obtained from tvm runtime as AsyncPackedFunc * through the asyncify mechanism * * You only need to call it if the function may contain callback into async * JS function via asynctify. A common one can be GPU synchronize. * * It is always safe to wrap any function

(func: PackedFunc)

Source from the content-addressed store, hash-verified

1770 * @returns The wrapped AsyncPackedFunc
1771 */
1772 wrapAsyncifyPackedFunc(func: PackedFunc): AsyncPackedFunc {
1773 const asyncFunc = this.asyncifyHandler.wrapExport(func) as AsyncPackedFunc;
1774 asyncFunc.dispose = func.dispose;
1775 asyncFunc._tvmPackedCell = func._tvmPackedCell;
1776 return asyncFunc;
1777 }
1778
1779 /**
1780 * Register async function as asynctify callable in global environment.

Callers 1

Calls 1

wrapExportMethod · 0.80

Tested by

no test coverage detected