* 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)
| 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. |
no test coverage detected