public class Module extends TVMValue
| Modifier and Type | Field and Description |
|---|---|
long |
handle |
| Modifier and Type | Method and Description |
|---|---|
Module |
asModule()
Easy for user to get the instance from returned TVMValue.
|
static boolean |
enabled(String target)
Whether module runtime is enabled for target,
e.g., The following code checks if cuda is enabled.
|
Function |
entryFunc()
Get the entry function.
|
protected void |
finalize() |
Function |
getFunction(String name) |
Function |
getFunction(String name,
boolean queryImports)
Get function from the module.
|
void |
importModule(Module module)
Add module to the import list of current one.
|
static Module |
load(String path) |
static Module |
load(String path,
String fmt)
Load module from file.
|
void |
release()
Release the Module.
|
String |
typeKey()
Get type key of the module.
|
protected void finalize()
throws Throwable
public Module asModule()
public void release()
We highly recommend you to do this manually since the GC strategy is lazy.
public Function entryFunc()
public Function getFunction(String name, boolean queryImports)
name - The name of the function.queryImports - Whether also query modules imported by this module.public void importModule(Module module)
module - The other module.public String typeKey()
public static Module load(String path, String fmt)
path - The path to the module file.fmt - The format of the file,
if not specified it will be inferred from suffix of the file.public static boolean enabled(String target)
target - The target device type.Copyright © 2022. All rights reserved.