@Namespace(value="tvm::runtime") @NoOffset @Properties(inherit=tvm_runtime.class) public class ModuleNode extends TVMObject
class MyModuleNode : public ModuleNode {
public:
// implement the interface
};
// use make_object to create a specific
// instace of MyModuleNode.
Module CreateMyModule() {
ObjectPtr<MyModuleNode> n =
tvm::runtime::make_object<MyModuleNode>();
return Module(n);
}
TVMObject.FDeleter
Pointer.CustomDeallocator, Pointer.Deallocator, Pointer.NativeDeallocator, Pointer.ReferenceCounter
Modifier and Type | Field and Description |
---|---|
static int |
_type_child_slots |
static boolean |
_type_final |
static int |
_type_index |
_type_child_slots_can_overflow, _type_has_method_sequal_reduce, _type_has_method_shash_reduce, _type_has_method_visit_attrs
Constructor and Description |
---|
ModuleNode(Pointer p)
Pointer cast constructor.
|
Modifier and Type | Method and Description |
---|---|
static int |
_GetOrAllocRuntimeTypeIndex() |
static int |
_type_child_slots() |
static boolean |
_type_final() |
static int |
_type_index() |
static BytePointer |
_type_key() |
void |
ClearImports()
\brief Clear all imports of the module.
|
TVMString |
GetFormat()
\brief Get the format of the module, when available.
|
PackedFunc |
GetFuncFromEnv(TVMString name)
\brief Get a function from current environment
The environment includes all the imports as well as Global functions.
|
PackedFunc |
GetFunction(TVMString name) |
PackedFunc |
GetFunction(TVMString name,
boolean query_imports)
\brief Get packed function from current module by name.
|
PackedFunc |
GetFunction(TVMString name,
ObjectPtr sptr_to_self)
\brief Get a PackedFunc from module.
|
int |
GetPropertyMask()
\brief Returns bitmap of property.
|
TVMString |
GetSource() |
TVMString |
GetSource(TVMString format)
\brief Get the source code of module, when available.
|
boolean |
ImplementsFunction(TVMString name) |
boolean |
ImplementsFunction(TVMString name,
boolean query_imports)
\brief Returns true if this module has a definition for a function of \p name.
|
void |
Import(Module other)
\brief Import another module into this module.
|
Module |
imports() |
boolean |
IsBinarySerializable()
\brief Returns true if this module is 'Binary Serializable'.
|
boolean |
IsDSOExportable()
\brief Returns true if this module is 'DSO exportable'.
|
static int |
RuntimeTypeIndex() |
void |
SaveToBinary(Stream stream)
\brief Save the module to binary stream.
|
void |
SaveToFile(TVMString file_name,
TVMString format)
\brief Save the module to file.
|
BytePointer |
type_key() |
_type_child_slots_can_overflow, _type_has_method_sequal_reduce, _type_has_method_shash_reduce, _type_has_method_visit_attrs, getPointer, GetTypeKey, GetTypeKeyHash, position, put, type_index, TypeIndex2Key, TypeIndex2KeyHash, TypeKey2Index, TypeKey2Index, unique
address, asBuffer, asByteBuffer, availablePhysicalBytes, calloc, capacity, capacity, close, deallocate, deallocate, deallocateReferences, deallocator, deallocator, equals, fill, formatBytes, free, getDirectBufferAddress, getPointer, getPointer, getPointer, hashCode, interruptDeallocatorThread, isNull, isNull, limit, limit, malloc, maxBytes, maxPhysicalBytes, memchr, memcmp, memcpy, memmove, memset, offsetAddress, offsetof, offsetof, parseBytes, physicalBytes, physicalBytesInaccurate, position, put, realloc, referenceCount, releaseReference, retainReference, setNull, sizeof, sizeof, toString, totalBytes, totalCount, totalPhysicalBytes, withDeallocator, zero
public static final int _type_index
public static final boolean _type_final
public static final int _type_child_slots
public ModuleNode(Pointer p)
Pointer(Pointer)
.@Cast(value="const char*") public BytePointer type_key()
@ByVal public PackedFunc GetFunction(@Const @ByRef TVMString name, @Const @ByRef ObjectPtr sptr_to_self)
name
- the name of the function.sptr_to_self
- The ObjectPtr that points to this module node.public void SaveToFile(@Const @ByRef TVMString file_name, @Const @ByRef TVMString format)
file_name
- The file to be saved to.format
- The format of the file.public void SaveToBinary(Stream stream)
stream
- The binary stream to save to.
\note It is recommended to implement this for device modules,
but not necessarily host modules.
We can use this to do AOT loading of bundled device functions.@ByVal public TVMString GetSource(@Const @ByRef(nullValue="tvm::runtime::String(\"\")") TVMString format)
format
- Format of the source code, can be empty by default.@ByVal public TVMString GetFormat()
@ByVal public PackedFunc GetFunction(@Const @ByRef TVMString name, @Cast(value="bool") boolean query_imports)
name
- The name of the function.query_imports
- Whether also query dependency modules.@ByVal public PackedFunc GetFunction(@Const @ByRef TVMString name)
public void Import(@ByVal Module other)
other
- The module to be imported.
\note Cyclic dependency is not allowed among modules,
An error will be thrown when cyclic dependency is detected.@Const public PackedFunc GetFuncFromEnv(@Const @ByRef TVMString name)
name
- name of the function.public void ClearImports()
@StdVector public Module imports()
public int GetPropertyMask()
@Cast(value="bool") public boolean IsDSOExportable()
@Cast(value="bool") public boolean IsBinarySerializable()
@Cast(value="bool") public boolean ImplementsFunction(@Const @ByRef TVMString name, @Cast(value="bool") boolean query_imports)
@Cast(value="bool") public boolean ImplementsFunction(@Const @ByRef TVMString name)
@MemberGetter @Cast(value="const uint32_t") public static int _type_index()
@MemberGetter @Cast(value="const char*") public static BytePointer _type_key()
@MemberGetter @Cast(value="const bool") public static boolean _type_final()
@MemberGetter public static int _type_child_slots()
Copyright © 2024. All rights reserved.