Constructor
importObject can also be a LibraryProvider object, a WASI object, or an object containing wasmLibraryProvider field.
The input module or instance.
The imports to initialize the wasmInstance if it is not provided.
Additional wasm instance argument for deferred construction.
Directly specified environment module.
Attach a detached obj to the auto-release pool of the current scope.
The input obj.
Begin a new scope for tracking object disposal.
Benchmark stable execution of the run function.
Detach the object from the current scope so it won't be released via auto-release during endscope.
User needs to either explicitly call obj.dispose(), or attachToCurrentScope to re-attach to the current scope.
This function can be used to return values to the parent scope.
The object.
Create an empty NDArray with given shape and dtype.
The shape of the array.
The data type of the array.
The device of the ndarray.
The created ndarray.
End a scope and release all created TVM objects under the current scope.
Exception: one can call retainToParentScope to move a value to parent scope.
Get global PackedFunc from the runtime.
The name of the function.
The result function.
Initialize webgpu in the runtime.
The given GPU device.
Check if func is PackedFunc.
The input.
The check result.
List all the global function names registered in the runtime.
The name list.
Create an tuple TVMArray input array.
The input array can be passed to tvm runtime function and needs to b explicitly disposed.
The input array
The result array.
Move obj's attachment to the parent scope.
This function is useful to make sure objects are still alive when exit the current scope.
The object to be moved.
The input obj.
Register an asyncfunction to be global function in the server.
The name of the function.
function to be registered.
Whether overwrite function in existing registry.
Register function to be global function in tvm runtime.
The name of the function.
Whether overwrite function in existing registry.
Register an object constructor.
The name of the function.
function to be registered.
Whether overwrite function in existing registry.
Set packed function arguments into the location indicated by argsValue and argsCode. Allocate new temporary space from the stack if necessary.
The input arguments.
The offset of argsValue.
The offset of argsCode.
Get system-wide library module in the wasm. System lib is a global module that contains self register functions in startup.
The system library module.
Convert dtype to DLDataType
The input dtype string or DLDataType.
The converted result.
Convert func to PackedFunc
Input function.
The converted function.
Get type index from type key.
The type key.
The corresponding type index.
Perform action under a new scope.
The action function.
The result value.
Generated using TypeDoc
TVM runtime instance.
All objects(NDArray, Module, PackedFunc) returned by TVM runtim function call and PackedFunc instance are tracked through a scope mechanism that will get auto-released when we call EndScope.
This is necessarily to be able to release the underlying WASM and WebGPU memory that are not tracked through JS native garbage collection mechanism.
This does mean that we have to get familar with the following functions: