public class tvm_runtime extends tvm_runtime
tvm_runtime.PackedFuncFType
Modifier and Type | Field and Description |
---|---|
static int |
DLPACK_ABI_VERSION
\brief The current ABI version of dlpack
|
static int |
DLPACK_VERSION
\brief The current version of dlpack
|
static int |
DMLC_ENABLE_RTTI
\brief whether RTTI is enabled
|
static int |
DMLC_ENABLE_STD_THREAD
\brief Enable std::thread related modules,
Used to disable some module in mingw compile.
|
static int |
DMLC_IO_NO_ENDIAN_SWAP |
static int |
DMLC_IO_USE_LITTLE_ENDIAN
\brief Use little endian for binary serialization
if this is set to 0, use big endian.
|
static int |
DMLC_LITTLE_ENDIAN |
static int |
DMLC_LOG_BEFORE_THROW
\brief whether always log a message before throw
This can help identify the error that cannot be catched.
|
static int |
DMLC_LOG_CUSTOMIZE
\brief Whether to use customized logger,
whose output can be decided by other libraries.
|
static int |
DMLC_LOG_DEBUG
\brief Whether to enable debug logging feature.
|
static int |
DMLC_LOG_FATAL_THROW
\brief whether throw dmlc::Error instead of
directly calling abort when FATAL error occured
NOTE: this may still not be perfect.
|
static int |
DMLC_LOG_NODATE
\brief Whether to disable date message on the log.
|
static int |
DMLC_MODERN_THREAD_LOCAL
\brief Whether to use modern thread local construct
|
static int |
DMLC_NO_EXCEPTION |
static int |
DMLC_THROW_EXCEPTION |
static int |
DMLC_USE_CXX11
\brief whether or not use c++11 support
|
static int |
DMLC_USE_FOPEN64
\brief whether use fopen64
|
static int |
DMLC_USE_GLOG
\brief whether use glog for logging
|
static int |
DMLC_USE_HDFS
\brief whether compile with hdfs support
|
static int |
DMLC_USE_PS
\brief whether or not use parameter server
|
static int |
DMLC_USE_REGEX |
static int |
DMLC_USE_S3
\brief whether compile with s3 support
|
static int |
kBinarySerializable
enum tvm::runtime::ModulePropertyMask
|
static int |
kDirectory
enum dmlc::io::FileType
|
static int |
kDLAOCL
enum TVMDeviceExtType
|
static int |
kDLBfloat
enum DLDataTypeCode
|
static int |
kDLComplex
enum DLDataTypeCode
|
static int |
kDLCPU
enum DLDeviceType
|
static int |
kDLCUDA
enum DLDeviceType
|
static int |
kDLCUDAHost
enum DLDeviceType
|
static int |
kDLCUDAManaged
enum DLDeviceType
|
static int |
kDLDevice
enum TVMArgTypeCode
|
static int |
kDLExtDev
enum DLDeviceType
|
static int |
kDLFloat
enum DLDataTypeCode
|
static int |
kDLHexagon
enum DLDeviceType
|
static int |
kDLInt
enum DLDataTypeCode
|
static int |
kDLMetal
enum DLDeviceType
|
static int |
kDLMicroDev
enum TVMDeviceExtType
|
static int |
kDLOneAPI
enum DLDeviceType
|
static int |
kDLOpaqueHandle
enum DLDataTypeCode
|
static int |
kDLOpenCL
enum DLDeviceType
|
static int |
kDLROCM
enum DLDeviceType
|
static int |
kDLROCMHost
enum DLDeviceType
|
static int |
kDLSDAccel
enum TVMDeviceExtType
|
static int |
kDLUInt
enum DLDataTypeCode
|
static int |
kDLVPI
enum DLDeviceType
|
static int |
kDLVulkan
enum DLDeviceType
|
static int |
kDLWebGPU
enum DLDeviceType
|
static int |
kDSOExportable
enum tvm::runtime::ModulePropertyMask
|
static int |
kFile
enum dmlc::io::FileType
|
static int |
kOpenGL
enum TVMDeviceExtType
|
static int |
kRunnable
enum tvm::runtime::ModulePropertyMask
|
static int |
kTVMArgBool
enum TVMArgTypeCode
|
static int |
kTVMArgFloat
enum TVMArgTypeCode
|
static int |
kTVMArgInt
enum TVMArgTypeCode
|
static int |
kTVMBytes
enum TVMArgTypeCode
|
static int |
kTVMDataType
enum TVMArgTypeCode
|
static int |
kTVMDLTensorHandle
enum TVMArgTypeCode
|
static int |
kTVMExtBegin
enum TVMArgTypeCode
|
static int |
kTVMExtEnd
enum TVMArgTypeCode
|
static int |
kTVMExtReserveEnd
enum TVMArgTypeCode
|
static int |
kTVMModuleHandle
enum TVMArgTypeCode
|
static int |
kTVMNDArrayHandle
enum TVMArgTypeCode
|
static int |
kTVMNNVMFirst
enum TVMArgTypeCode
|
static int |
kTVMNNVMLast
enum TVMArgTypeCode
|
static int |
kTVMNullptr
enum TVMArgTypeCode
|
static int |
kTVMObjectHandle
enum TVMArgTypeCode
|
static int |
kTVMObjectRValueRefArg
enum TVMArgTypeCode
|
static int |
kTVMOpaqueHandle
enum TVMArgTypeCode
|
static int |
kTVMPackedFuncHandle
enum TVMArgTypeCode
|
static int |
kTVMStr
enum TVMArgTypeCode
|
static String |
TVM_HARCODED_INTEGER_CHANGED_MSG |
static int |
TVM_OBJECT_ATOMIC_REF_COUNTER
\brief Whether or not use atomic reference counter.
|
static int |
TVM_RUNTIME_HEADER_ONLY
\file tvm/runtime/packed_func.h
\brief Type-erased function used across TVM API.
|
static String |
TVM_VERSION
\endcond
|
static int |
TVMDeviceExtType_End
enum TVMDeviceExtType
|
static int |
USE_FALLBACK_STL_MAP
\file tvm/runtime/container/map.h
\brief Runtime Map container types.
|
Constructor and Description |
---|
tvm_runtime() |
Modifier and Type | Method and Description |
---|---|
static TVMString |
add(BytePointer lhs,
TVMString rhs) |
static TVMString |
add(String lhs,
TVMString rhs) |
static TVMString |
add(TVMString lhs,
BytePointer rhs) |
static TVMString |
add(TVMString lhs,
String rhs) |
static TVMString |
add(TVMString lhs,
TVMString rhs)
\brief An object representing string moved from std::string.
|
static BytePointer |
ArgTypeCode2Str(int type_code)
\brief Convert argument type code to string.
|
static BytePointer |
BeginPtr(BytePointer str)
\brief get the beginning address of a string
|
static String |
BeginPtr(String str)
\brief get the beginning address of a const string
|
static void |
ByteSwap(Pointer data,
long elem_bytes,
long num_elems)
\brief A generic inplace byte swapping function.
|
static BytePointer |
DLDataType2String(DLDataType t)
\brief convert a TVM type to string.
|
static BytePointer |
DLDataTypeCode2Str(int type_code)
\brief Convert type code to its name
|
static BytePointer |
DLDeviceType2Str(int type)
\brief The name of DLDeviceType.
|
static int |
DMLC_IO_NO_ENDIAN_SWAP()
\brief whether serialize using little endian
|
static int |
DMLC_LITTLE_ENDIAN()
Copyright (c) 2017 by Contributors
\file endian.h
\brief Endian testing, need c++11
|
static int |
DMLC_NO_EXCEPTION() |
static int |
DMLC_THROW_EXCEPTION()
\brief Disable copy constructor and assignment operator.
|
static int |
DMLC_USE_REGEX()
\brief whether enable regex support, actually need g++-4.9 or higher
|
static void |
EnvCheckSignals()
\brief Check if signals have been sent to the process and if so
invoke the registered signal handler in the frontend environment.
|
static boolean |
equals(BytePointer lhs,
TVMString rhs) |
static boolean |
equals(String lhs,
TVMString rhs) |
static boolean |
equals(TVMString lhs,
BytePointer rhs) |
static boolean |
equals(TVMString lhs,
String rhs) |
static boolean |
equals(TVMString lhs,
TVMString rhs) |
static BytePointer |
GetCustomTypeName(byte type_code)
\brief Runtime utility for getting custom type name from code
|
static boolean |
GetCustomTypeRegistered(byte type_code)
\brief Runtime utility for checking whether custom type is registered
|
static long |
GetDataSize(DLTensor arr)
\brief return the size of data the DLTensor hold, in term of number of bytes
|
static DLDevice |
GetPreferredHostDevice(DLDevice device)
\brief Get the preferred host device from the input device.
|
static int |
GetVectorBytes(DataType dtype)
\brief Get the number of bytes needed in a vector.
|
static boolean |
greaterThan(BytePointer lhs,
TVMString rhs) |
static boolean |
greaterThan(String lhs,
TVMString rhs) |
static boolean |
greaterThan(TVMString lhs,
BytePointer rhs) |
static boolean |
greaterThan(TVMString lhs,
String rhs) |
static boolean |
greaterThan(TVMString lhs,
TVMString rhs) |
static boolean |
greaterThanEquals(BytePointer lhs,
TVMString rhs) |
static boolean |
greaterThanEquals(String lhs,
TVMString rhs) |
static boolean |
greaterThanEquals(TVMString lhs,
BytePointer rhs) |
static boolean |
greaterThanEquals(TVMString lhs,
String rhs) |
static boolean |
greaterThanEquals(TVMString lhs,
TVMString rhs) |
static void |
InitLogging(BytePointer argv0)
\brief optionally redirect to google's init log
|
static void |
InitLogging(String argv0) |
static boolean |
IsContiguous(DLTensor arr)
\brief check if a DLTensor is contiguous.
|
static long |
kTVMNDArrayMagic()
\brief Magic number for NDArray file
|
static boolean |
lessThan(BytePointer lhs,
TVMString rhs) |
static boolean |
lessThan(String lhs,
TVMString rhs) |
static boolean |
lessThan(TVMString lhs,
BytePointer rhs) |
static boolean |
lessThan(TVMString lhs,
String rhs) |
static boolean |
lessThan(TVMString lhs,
TVMString rhs) |
static boolean |
lessThanEquals(BytePointer lhs,
TVMString rhs) |
static boolean |
lessThanEquals(String lhs,
TVMString rhs) |
static boolean |
lessThanEquals(TVMString lhs,
BytePointer rhs) |
static boolean |
lessThanEquals(TVMString lhs,
String rhs) |
static boolean |
lessThanEquals(TVMString lhs,
TVMString rhs) |
static long |
LogStackTraceLevel()
Copyright (c) 2015 by Contributors
\file logging.h
\brief defines logging macros of dmlc
allows use of GLOG, fall back to internal
implementation when disabled
|
static ArrayNodePtr |
makeArrayNode()
\brief Allocate an object using default allocator.
|
static boolean |
notEquals(BytePointer lhs,
TVMString rhs) |
static boolean |
notEquals(String lhs,
TVMString rhs) |
static boolean |
notEquals(TVMString lhs,
BytePointer rhs) |
static boolean |
notEquals(TVMString lhs,
String rhs) |
static boolean |
notEquals(TVMString lhs,
TVMString rhs) |
static NullOptType |
NullOpt()
\file tvm/runtime/container/optional.h
\brief Runtime Optional container types.
|
static byte |
ParseCustomDatatype(BytePointer s,
byte[] scan) |
static byte |
ParseCustomDatatype(BytePointer s,
ByteBuffer scan) |
static byte |
ParseCustomDatatype(BytePointer s,
BytePointer scan) |
static byte |
ParseCustomDatatype(BytePointer s,
PointerPointer scan)
\brief Runtime utility for parsing string of the form "custom[
|
static byte |
ParseCustomDatatype(String s,
byte[] scan) |
static byte |
ParseCustomDatatype(String s,
ByteBuffer scan) |
static byte |
ParseCustomDatatype(String s,
BytePointer scan) |
static boolean |
RuntimeEnabled(TVMString target)
\brief Check if runtime module is enabled for target.
|
static boolean |
SaveDLTensor(Stream strm,
DLTensor tensor)
\brief Save a DLTensor to stream
|
static Pointer |
shiftLeft(Pointer os,
DataType dtype) |
static Pointer |
shiftLeft(Pointer os,
DLDataType t) |
static Pointer |
shiftLeft(Pointer out,
Module module) |
static Pointer |
shiftLeft(Pointer os,
ShapeTuple shape)
\brief An object representing shape tuple moved from std::vector.
|
static Pointer |
shiftLeft(Pointer out,
TVMString input) |
static BytePointer |
StackTrace() |
static BytePointer |
StackTrace(long start_frame,
long stack_size) |
static DLDataType |
String2DLDataType(BytePointer s)
\brief convert a string to TVM type.
|
static DLDataType |
String2DLDataType(String s) |
static BytePointer |
tvm_dev_mblob()
\brief Global variable to store device module blob
|
static BytePointer |
tvm_entrypoint_suffix()
\brief Model entrypoint generated as an interface to the AOT function outside of TIR
|
static BytePointer |
tvm_get_c_metadata()
\brief A PackedFunc that retrieves exported metadata.
|
static BytePointer |
tvm_global_barrier_state()
\brief Auxiliary counter to global barrier.
|
static BytePointer |
tvm_lookup_linked_param()
\brief A PackedFunc that looks up linked parameters by storage_id.
|
static BytePointer |
tvm_module_ctx()
\brief Global variable to store module context.
|
static BytePointer |
tvm_module_main()
\brief Placeholder for the module's entry function.
|
static BytePointer |
tvm_param_prefix()
\brief Prefix for parameter symbols emitted into the main program.
|
static BytePointer |
tvm_prepare_global_barrier()
\brief Prepare the global barrier before kernels that uses global barrier.
|
static BytePointer |
tvm_set_device()
\brief global function to set device
|
static void |
TVMAPISetLastError(BytePointer msg)
\brief Used for implementing C API function.
|
static void |
TVMAPISetLastError(String msg) |
static void |
TVMAPISetLastPythonError(Pointer py_object)
\brief Used for implementing C API function.
|
static int |
TVMArrayAlloc(long[] shape,
int ndim,
int dtype_code,
int dtype_bits,
int dtype_lanes,
int device_type,
int device_id,
DLTensor out) |
static int |
TVMArrayAlloc(long[] shape,
int ndim,
int dtype_code,
int dtype_bits,
int dtype_lanes,
int device_type,
int device_id,
PointerPointer out) |
static int |
TVMArrayAlloc(LongBuffer shape,
int ndim,
int dtype_code,
int dtype_bits,
int dtype_lanes,
int device_type,
int device_id,
DLTensor out) |
static int |
TVMArrayAlloc(LongBuffer shape,
int ndim,
int dtype_code,
int dtype_bits,
int dtype_lanes,
int device_type,
int device_id,
PointerPointer out) |
static int |
TVMArrayAlloc(LongPointer shape,
int ndim,
int dtype_code,
int dtype_bits,
int dtype_lanes,
int device_type,
int device_id,
DLTensor out) |
static int |
TVMArrayAlloc(LongPointer shape,
int ndim,
int dtype_code,
int dtype_bits,
int dtype_lanes,
int device_type,
int device_id,
PointerPointer out)
\brief Allocate a nd-array's memory,
including space of shape, of given spec.
|
static int |
TVMArrayCopyFromBytes(DLTensor handle,
Pointer data,
long nbytes)
\brief Copy array data from CPU byte array.
|
static int |
TVMArrayCopyFromTo(DLTensor from,
DLTensor to,
TVMStreamHandle stream)
\brief Copy the array, both from and to must be valid during the copy.
|
static int |
TVMArrayCopyToBytes(DLTensor handle,
Pointer data,
long nbytes)
\brief Copy array data to CPU byte array.
|
static int |
TVMArrayFree(DLTensor handle)
\brief Free the TVM Array.
|
static int |
TVMArrayFromDLPack(DLManagedTensor from,
DLTensor out) |
static int |
TVMArrayFromDLPack(DLManagedTensor from,
PointerPointer out)
\brief Produce an array from the DLManagedTensor that shares data memory
with the DLManagedTensor.
|
static TVMObject |
TVMArrayHandleToObjectHandle(DLTensor handle) |
static int |
TVMArrayToDLPack(DLTensor from,
DLManagedTensor out) |
static int |
TVMArrayToDLPack(DLTensor from,
PointerPointer out)
\brief Produce a DLMangedTensor from the array that shares data memory with
the array.
|
static int |
TVMByteArrayFree(TVMByteArray arr)
\brief Free a TVMByteArray returned from TVMFuncCall, and associated memory.
|
static int |
TVMCbArgToReturn(TVMValue value,
int[] code) |
static int |
TVMCbArgToReturn(TVMValue value,
IntBuffer code) |
static int |
TVMCbArgToReturn(TVMValue value,
IntPointer code)
\brief Inplace translate callback argument value to return value.
|
static int |
TVMCFuncSetReturn(TVMRetValueHandle ret,
TVMValue value,
int[] type_code,
int num_ret) |
static int |
TVMCFuncSetReturn(TVMRetValueHandle ret,
TVMValue value,
IntBuffer type_code,
int num_ret) |
static int |
TVMCFuncSetReturn(TVMRetValueHandle ret,
TVMValue value,
IntPointer type_code,
int num_ret)
\brief Set the return value of TVMPackedCFunc.
|
static int |
TVMDeviceAllocDataSpace(DLDevice dev,
long nbytes,
long alignment,
DLDataType type_hint,
Pointer out_data) |
static int |
TVMDeviceAllocDataSpace(DLDevice dev,
long nbytes,
long alignment,
DLDataType type_hint,
PointerPointer out_data)
\brief Allocate a data space on device.
|
static int |
TVMDeviceAllocDataSpaceWithScope(DLDevice dev,
int ndim,
long[] shape,
DLDataType dtype,
BytePointer mem_scope,
Pointer out_data) |
static int |
TVMDeviceAllocDataSpaceWithScope(DLDevice dev,
int ndim,
long[] shape,
DLDataType dtype,
String mem_scope,
Pointer out_data) |
static int |
TVMDeviceAllocDataSpaceWithScope(DLDevice dev,
int ndim,
LongBuffer shape,
DLDataType dtype,
BytePointer mem_scope,
Pointer out_data) |
static int |
TVMDeviceAllocDataSpaceWithScope(DLDevice dev,
int ndim,
LongBuffer shape,
DLDataType dtype,
String mem_scope,
Pointer out_data) |
static int |
TVMDeviceAllocDataSpaceWithScope(DLDevice dev,
int ndim,
LongPointer shape,
DLDataType dtype,
BytePointer mem_scope,
Pointer out_data) |
static int |
TVMDeviceAllocDataSpaceWithScope(DLDevice dev,
int ndim,
LongPointer shape,
DLDataType dtype,
BytePointer mem_scope,
PointerPointer out_data)
\brief Allocate a data space on device with special memory scope.
|
static int |
TVMDeviceAllocDataSpaceWithScope(DLDevice dev,
int ndim,
LongPointer shape,
DLDataType dtype,
String mem_scope,
Pointer out_data) |
static int |
TVMDeviceCopyDataFromTo(DLTensor from,
DLTensor to,
TVMStreamHandle stream)
\brief Copy data from one place to another.
|
static int |
TVMDeviceFreeDataSpace(DLDevice dev,
Pointer ptr)
\brief Free a data space on device.
|
static void |
TVMDLManagedTensorCallDeleter(DLManagedTensor dltensor)
\brief Delete (free) a DLManagedTensor's data.
|
static void |
TVMDropLastPythonError()
\brief Remove the propagated python error, if any
Removes the TVM-held reference to a thrown python exception object.
|
static int |
TVMFuncCall(TVMFunctionHandle func,
TVMValue arg_values,
int[] type_codes,
int num_args,
TVMValue ret_val,
int[] ret_type_code) |
static int |
TVMFuncCall(TVMFunctionHandle func,
TVMValue arg_values,
IntBuffer type_codes,
int num_args,
TVMValue ret_val,
IntBuffer ret_type_code) |
static int |
TVMFuncCall(TVMFunctionHandle func,
TVMValue arg_values,
IntPointer type_codes,
int num_args,
TVMValue ret_val,
IntPointer ret_type_code)
\brief Call a Packed TVM Function.
|
static int |
TVMFuncCreateFromCFunc(TVMPackedCFunc func,
Pointer resource_handle,
TVMPackedCFuncFinalizer fin,
TVMFunctionHandle out)
\brief Wrap a TVMPackedCFunc to become a FunctionHandle.
|
static int |
TVMFuncFree(TVMFunctionHandle func)
\brief Free the function when it is no longer needed.
|
static int |
TVMFuncGetGlobal(BytePointer name,
TVMFunctionHandle out)
\brief Get a global function.
|
static int |
TVMFuncGetGlobal(String name,
TVMFunctionHandle out) |
static int |
TVMFuncListGlobalNames(int[] out_size,
PointerPointer out_array) |
static int |
TVMFuncListGlobalNames(IntBuffer out_size,
PointerPointer out_array) |
static int |
TVMFuncListGlobalNames(IntPointer out_size,
PointerPointer out_array)
\brief List all the globally registered function name
|
static int |
TVMFuncRegisterGlobal(BytePointer name,
TVMFunctionHandle f,
int override)
\brief Register the function to runtime's global table.
|
static int |
TVMFuncRegisterGlobal(String name,
TVMFunctionHandle f,
int override) |
static int |
TVMFuncRemoveGlobal(BytePointer name)
\brief Remove a global function.
|
static int |
TVMFuncRemoveGlobal(String name) |
static BytePointer |
TVMGetLastBacktrace()
\brief Return the backtrace of the most recent error
Returns the backtrace of the most recent error, if an error exists,
and the error contains a backtrace.
|
static BytePointer |
TVMGetLastError()
\brief return str message of the last error
all function in this file will return 0 when success
and nonzero when an error occurred,
TVMGetLastError can be called to retrieve the error
this function is threadsafe and can be called by different thread
|
static Pointer |
TVMGetLastPythonError()
\brief Return the previous python error, if any.
|
static int |
TVMModFree(TVMModuleHandle mod)
\brief Free the Module
|
static int |
TVMModGetFunction(TVMModuleHandle mod,
BytePointer func_name,
int query_imports,
TVMFunctionHandle out)
\brief Get function from the module.
|
static int |
TVMModGetFunction(TVMModuleHandle mod,
String func_name,
int query_imports,
TVMFunctionHandle out) |
static int |
TVMModImport(TVMModuleHandle mod,
TVMModuleHandle dep)
\brief Add dep to mod's dependency.
|
static int |
TVMModLoadFromFile(BytePointer file_name,
BytePointer format,
TVMModuleHandle out)
\brief Load module from file.
|
static int |
TVMModLoadFromFile(String file_name,
String format,
TVMModuleHandle out) |
static int |
TVMObjectDerivedFrom(int child_type_index,
int parent_type_index,
int[] is_derived) |
static int |
TVMObjectDerivedFrom(int child_type_index,
int parent_type_index,
IntBuffer is_derived) |
static int |
TVMObjectDerivedFrom(int child_type_index,
int parent_type_index,
IntPointer is_derived)
\brief Check that an object is derived from another.
|
static int |
TVMObjectFree(TVMObjectHandle obj)
\brief Free the object.
|
static int |
TVMObjectGetTypeIndex(TVMObjectHandle obj,
int[] out_tindex) |
static int |
TVMObjectGetTypeIndex(TVMObjectHandle obj,
IntBuffer out_tindex) |
static int |
TVMObjectGetTypeIndex(TVMObjectHandle obj,
IntPointer out_tindex)
\brief Get the type_index from an object.
|
static int |
TVMObjectRetain(TVMObjectHandle obj)
\brief Increase the reference count of an object.
|
static int |
TVMObjectTypeIndex2Key(int tindex,
byte[] out_type_key) |
static int |
TVMObjectTypeIndex2Key(int tindex,
ByteBuffer out_type_key) |
static int |
TVMObjectTypeIndex2Key(int tindex,
BytePointer out_type_key) |
static int |
TVMObjectTypeIndex2Key(int tindex,
PointerPointer out_type_key)
\brief Convert type index to type key.
|
static int |
TVMObjectTypeKey2Index(BytePointer type_key,
int[] out_tindex) |
static int |
TVMObjectTypeKey2Index(BytePointer type_key,
IntBuffer out_tindex) |
static int |
TVMObjectTypeKey2Index(BytePointer type_key,
IntPointer out_tindex)
\brief Convert type key to type index.
|
static int |
TVMObjectTypeKey2Index(String type_key,
int[] out_tindex) |
static int |
TVMObjectTypeKey2Index(String type_key,
IntBuffer out_tindex) |
static int |
TVMObjectTypeKey2Index(String type_key,
IntPointer out_tindex) |
static int |
TVMSetStream(int device_type,
int device_id,
TVMStreamHandle handle)
\brief Set the runtime stream of current thread to be stream.
|
static int |
TVMStreamCreate(int device_type,
int device_id,
TVMStreamHandle out)
\brief Create a new runtime stream.
|
static int |
TVMStreamFree(int device_type,
int device_id,
TVMStreamHandle stream)
\brief Free a created stream handle.
|
static int |
TVMStreamStreamSynchronize(int device_type,
int device_id,
TVMStreamHandle src,
TVMStreamHandle dst)
\brief Synchronize two streams of execution.
|
static int |
TVMSynchronize(int device_type,
int device_id,
TVMStreamHandle stream)
\brief Wait until all computations on stream completes.
|
static void |
TVMThrowLastError()
\brief Re-throw the most recent error.
|
static boolean |
TypeEqual(DLDataType lhs,
DLDataType rhs)
\brief Check whether two types are equal .
|
static boolean |
TypeMatch(DLDataType t,
int code,
int bits) |
static boolean |
TypeMatch(DLDataType t,
int code,
int bits,
int lanes)
\brief Check whether type matches the given spec.
|
init, map
public static final int DLPACK_VERSION
public static final int DLPACK_ABI_VERSION
public static final int kDLCPU
public static final int kDLCUDA
public static final int kDLCUDAHost
public static final int kDLOpenCL
public static final int kDLVulkan
public static final int kDLMetal
public static final int kDLVPI
public static final int kDLROCM
public static final int kDLROCMHost
public static final int kDLExtDev
public static final int kDLCUDAManaged
public static final int kDLOneAPI
public static final int kDLWebGPU
public static final int kDLHexagon
public static final int kDLInt
public static final int kDLUInt
public static final int kDLFloat
public static final int kDLOpaqueHandle
public static final int kDLBfloat
public static final int kDLComplex
public static final int DMLC_USE_GLOG
public static final int DMLC_LOG_FATAL_THROW
public static final int DMLC_LOG_BEFORE_THROW
public static final int DMLC_LOG_CUSTOMIZE
public static final int DMLC_LOG_DEBUG
public static final int DMLC_LOG_NODATE
public static final int DMLC_USE_HDFS
public static final int DMLC_USE_S3
public static final int DMLC_USE_PS
public static final int DMLC_USE_CXX11
public static final int DMLC_MODERN_THREAD_LOCAL
public static final int DMLC_ENABLE_RTTI
public static final int DMLC_USE_FOPEN64
public static final int DMLC_IO_USE_LITTLE_ENDIAN
public static final int DMLC_ENABLE_STD_THREAD
public static final int DMLC_USE_REGEX
public static final int DMLC_THROW_EXCEPTION
public static final int DMLC_NO_EXCEPTION
public static final int kFile
public static final int kDirectory
public static final int DMLC_LITTLE_ENDIAN
public static final int DMLC_IO_NO_ENDIAN_SWAP
public static final String TVM_VERSION
public static final int kDLAOCL
public static final int kDLSDAccel
public static final int kOpenGL
public static final int kDLMicroDev
public static final int TVMDeviceExtType_End
public static final String TVM_HARCODED_INTEGER_CHANGED_MSG
public static final int kTVMArgInt
public static final int kTVMArgFloat
public static final int kTVMOpaqueHandle
public static final int kTVMNullptr
public static final int kTVMDataType
public static final int kDLDevice
public static final int kTVMDLTensorHandle
public static final int kTVMObjectHandle
public static final int kTVMModuleHandle
public static final int kTVMPackedFuncHandle
public static final int kTVMStr
public static final int kTVMBytes
public static final int kTVMNDArrayHandle
public static final int kTVMObjectRValueRefArg
public static final int kTVMArgBool
public static final int kTVMExtBegin
public static final int kTVMNNVMFirst
public static final int kTVMNNVMLast
public static final int kTVMExtReserveEnd
public static final int kTVMExtEnd
public static final int TVM_OBJECT_ATOMIC_REF_COUNTER
public static final int USE_FALLBACK_STL_MAP
public static final int kBinarySerializable
public static final int kRunnable
public static final int kDSOExportable
public static final int TVM_RUNTIME_HEADER_ONLY
@MemberGetter public static int DMLC_USE_REGEX()
@MemberGetter public static int DMLC_THROW_EXCEPTION()
@MemberGetter public static int DMLC_NO_EXCEPTION()
@Namespace(value="dmlc") @Cast(value="char*") public static BytePointer BeginPtr(@StdString @ByRef BytePointer str)
str
- input string@Namespace(value="dmlc") public static String BeginPtr(@StdString String str)
str
- input string@Namespace(value="dmlc") @Cast(value="size_t") public static long LogStackTraceLevel()
@Namespace(value="dmlc") @StdString public static BytePointer StackTrace(@Cast(value="size_t") long start_frame, @Cast(value="const size_t") long stack_size)
@Namespace(value="dmlc") @StdString public static BytePointer StackTrace()
@Namespace(value="dmlc") public static void InitLogging(@Cast(value="const char*") BytePointer argv0)
argv0
- The arguments.@Namespace(value="dmlc") public static void InitLogging(String argv0)
@MemberGetter public static int DMLC_LITTLE_ENDIAN()
@MemberGetter public static int DMLC_IO_NO_ENDIAN_SWAP()
@Namespace(value="dmlc") public static void ByteSwap(Pointer data, @Cast(value="size_t") long elem_bytes, @Cast(value="size_t") long num_elems)
data
- The data pointer.elem_bytes
- The number of bytes of the data elementsnum_elems
- Number of elements in the data.
\note Always try pass in constant elem_bytes to enable
compiler optimizationpublic static void TVMAPISetLastError(@Cast(value="const char*") BytePointer msg)
msg
- The error message to be set.public static void TVMAPISetLastError(String msg)
public static void TVMAPISetLastPythonError(Pointer py_object)
py_object
- The python exception to be setpublic static Pointer TVMGetLastPythonError()
@Cast(value="const char*") public static BytePointer TVMGetLastError()
@Cast(value="const char*") public static BytePointer TVMGetLastBacktrace()
public static void TVMDropLastPythonError()
public static void TVMThrowLastError()
LOG(FATAL) << TVMGetLastError()
, but includes handling to
propagate a python exception across C++ stack frames, or to append
a stack trace to an error message.public static int TVMModLoadFromFile(@Cast(value="const char*") BytePointer file_name, @Cast(value="const char*") BytePointer format, @ByPtrPtr TVMModuleHandle out)
file_name
- The file name to load the module from.format
- The format of the module.out
- The result modulepublic static int TVMModLoadFromFile(String file_name, String format, @ByPtrPtr TVMModuleHandle out)
public static int TVMModImport(TVMModuleHandle mod, TVMModuleHandle dep)
mod
- The module handle.dep
- The dependent module to be imported.public static int TVMModGetFunction(TVMModuleHandle mod, @Cast(value="const char*") BytePointer func_name, int query_imports, @ByPtrPtr TVMFunctionHandle out)
mod
- The module handle.func_name
- The name of the function.query_imports
- Whether to query imported modulesout
- The result function, can be NULL if it is not available.public static int TVMModGetFunction(TVMModuleHandle mod, String func_name, int query_imports, @ByPtrPtr TVMFunctionHandle out)
public static int TVMModFree(TVMModuleHandle mod)
mod
- The module to be freed.
\note This may not free up the module's resources.
If there is active TVMFunctionHandle uses the module
Or if this module is imported by another active module.
The all functions remains valid until TVMFuncFree is called.public static int TVMFuncFree(TVMFunctionHandle func)
func
- The function handlepublic static int TVMFuncCall(TVMFunctionHandle func, TVMValue arg_values, IntPointer type_codes, int num_args, TVMValue ret_val, IntPointer ret_type_code)
func
- node handle of the function.arg_values
- The argumentstype_codes
- The type codes of the argumentsnum_args
- Number of arguments.ret_val
- The return value.ret_type_code
- the type code of return value.public static int TVMFuncCall(TVMFunctionHandle func, TVMValue arg_values, IntBuffer type_codes, int num_args, TVMValue ret_val, IntBuffer ret_type_code)
public static int TVMFuncCall(TVMFunctionHandle func, TVMValue arg_values, int[] type_codes, int num_args, TVMValue ret_val, int[] ret_type_code)
public static int TVMCFuncSetReturn(TVMRetValueHandle ret, TVMValue value, IntPointer type_code, int num_ret)
ret
- The return value handle, pass by ret in TVMPackedCFuncvalue
- The value to be returned.type_code
- The type of the value to be returned.num_ret
- Number of return values, for now only 1 is supported.public static int TVMCFuncSetReturn(TVMRetValueHandle ret, TVMValue value, IntBuffer type_code, int num_ret)
public static int TVMCFuncSetReturn(TVMRetValueHandle ret, TVMValue value, int[] type_code, int num_ret)
public static int TVMCbArgToReturn(TVMValue value, IntPointer code)
value
- The value to be translated.code
- The type code to be translated.
\note This function will do a shallow copy when necessary.public static int TVMCbArgToReturn(TVMValue value, int[] code)
public static int TVMFuncCreateFromCFunc(TVMPackedCFunc func, Pointer resource_handle, TVMPackedCFuncFinalizer fin, @ByPtrPtr TVMFunctionHandle out)
func
- The packed C function.resource_handle
- The resource handle from front-end, can be NULL.fin
- The finalizer on resource handle when the FunctionHandle get freed, can be NULLout
- the result function handle.public static int TVMFuncRegisterGlobal(@Cast(value="const char*") BytePointer name, TVMFunctionHandle f, int override)
name
- The name of the function.f
- The function to be registered.override
- Whether allow override already registered function.public static int TVMFuncRegisterGlobal(String name, TVMFunctionHandle f, int override)
public static int TVMFuncGetGlobal(@Cast(value="const char*") BytePointer name, @ByPtrPtr TVMFunctionHandle out)
name
- The name of the function.out
- the result function pointer, NULL if it does not exist.
\note The function handle of global function is managed by TVM runtime,
So TVMFuncFree is should not be called when it get deleted.public static int TVMFuncGetGlobal(String name, @ByPtrPtr TVMFunctionHandle out)
public static int TVMFuncListGlobalNames(IntPointer out_size, @Cast(value="const char***") @ByPtrPtr PointerPointer out_array)
out_size
- The number of functionsout_array
- The array of function names.public static int TVMFuncListGlobalNames(IntBuffer out_size, @Cast(value="const char***") @ByPtrPtr PointerPointer out_array)
public static int TVMFuncListGlobalNames(int[] out_size, @Cast(value="const char***") @ByPtrPtr PointerPointer out_array)
public static int TVMFuncRemoveGlobal(@Cast(value="const char*") BytePointer name)
name
- The name of the function.public static int TVMFuncRemoveGlobal(String name)
public static int TVMArrayAlloc(@Cast(value="const tvm_index_t*") LongPointer shape, int ndim, int dtype_code, int dtype_bits, int dtype_lanes, int device_type, int device_id, @Cast(value="TVMArrayHandle*") PointerPointer out)
shape
- The shape of the array, the data content will be copied to outndim
- The number of dimension of the array.dtype_code
- The type code of the dtypedtype_bits
- The number of bits of dtypedtype_lanes
- The number of lanes in the dtype.device_type
- The device type.device_id
- The device id.out
- The output handle.public static int TVMArrayAlloc(@Cast(value="const tvm_index_t*") LongBuffer shape, int ndim, int dtype_code, int dtype_bits, int dtype_lanes, int device_type, int device_id, @ByPtrPtr @Cast(value="TVMArrayHandle*") DLTensor out)
public static int TVMArrayAlloc(@Cast(value="const tvm_index_t*") long[] shape, int ndim, int dtype_code, int dtype_bits, int dtype_lanes, int device_type, int device_id, @Cast(value="TVMArrayHandle*") PointerPointer out)
public static int TVMArrayAlloc(@Cast(value="const tvm_index_t*") LongPointer shape, int ndim, int dtype_code, int dtype_bits, int dtype_lanes, int device_type, int device_id, @ByPtrPtr @Cast(value="TVMArrayHandle*") DLTensor out)
public static int TVMArrayAlloc(@Cast(value="const tvm_index_t*") LongBuffer shape, int ndim, int dtype_code, int dtype_bits, int dtype_lanes, int device_type, int device_id, @Cast(value="TVMArrayHandle*") PointerPointer out)
public static int TVMArrayAlloc(@Cast(value="const tvm_index_t*") long[] shape, int ndim, int dtype_code, int dtype_bits, int dtype_lanes, int device_type, int device_id, @ByPtrPtr @Cast(value="TVMArrayHandle*") DLTensor out)
public static int TVMArrayFree(@Cast(value="TVMArrayHandle") DLTensor handle)
handle
- The array handle to be freed.public static int TVMArrayCopyFromBytes(@Cast(value="TVMArrayHandle") DLTensor handle, Pointer data, @Cast(value="size_t") long nbytes)
handle
- The array handle.data
- the data pointernbytes
- The number of bytes to copy.public static int TVMArrayCopyToBytes(@Cast(value="TVMArrayHandle") DLTensor handle, Pointer data, @Cast(value="size_t") long nbytes)
handle
- The array handle.data
- the data pointernbytes
- The number of bytes to copy.public static int TVMArrayCopyFromTo(@Cast(value="TVMArrayHandle") DLTensor from, @Cast(value="TVMArrayHandle") DLTensor to, TVMStreamHandle stream)
from
- The array to be copied from.to
- The target space.stream
- The stream where the copy happens, can be NULL.public static int TVMArrayFromDLPack(DLManagedTensor from, @Cast(value="TVMArrayHandle*") PointerPointer out)
from
- The source DLManagedTensor.out
- The output array handle.public static int TVMArrayFromDLPack(DLManagedTensor from, @ByPtrPtr @Cast(value="TVMArrayHandle*") DLTensor out)
public static int TVMArrayToDLPack(@Cast(value="TVMArrayHandle") DLTensor from, @Cast(value="DLManagedTensor**") PointerPointer out)
from
- The source array.out
- The DLManagedTensor handle.public static int TVMArrayToDLPack(@Cast(value="TVMArrayHandle") DLTensor from, @ByPtrPtr DLManagedTensor out)
public static void TVMDLManagedTensorCallDeleter(DLManagedTensor dltensor)
dltensor
- Pointer to the DLManagedTensor.public static int TVMStreamCreate(int device_type, int device_id, @ByPtrPtr TVMStreamHandle out)
device_type
- The device type.device_id
- The device id.out
- The new stream handle.public static int TVMStreamFree(int device_type, int device_id, TVMStreamHandle stream)
device_type
- The device type.device_id
- The device id.stream
- The stream to be freed.public static int TVMSetStream(int device_type, int device_id, TVMStreamHandle handle)
device_type
- The device type.device_id
- The device id.handle
- The stream handle.public static int TVMSynchronize(int device_type, int device_id, TVMStreamHandle stream)
device_type
- The device type.device_id
- The device id.stream
- The stream to be synchronized.public static int TVMStreamStreamSynchronize(int device_type, int device_id, TVMStreamHandle src, TVMStreamHandle dst)
device_type
- The device type.device_id
- The device id.src
- The source stream to synchronize.dst
- The destination stream to synchronize.public static int TVMObjectGetTypeIndex(TVMObjectHandle obj, @Cast(value="unsigned*") IntPointer out_tindex)
obj
- The object handle.out_tindex
- the output type index.public static int TVMObjectGetTypeIndex(TVMObjectHandle obj, @Cast(value="unsigned*") IntBuffer out_tindex)
public static int TVMObjectGetTypeIndex(TVMObjectHandle obj, @Cast(value="unsigned*") int[] out_tindex)
public static int TVMObjectTypeKey2Index(@Cast(value="const char*") BytePointer type_key, @Cast(value="unsigned*") IntPointer out_tindex)
type_key
- The key of the type.out_tindex
- the corresponding type index.public static int TVMObjectTypeKey2Index(String type_key, @Cast(value="unsigned*") IntBuffer out_tindex)
public static int TVMObjectTypeKey2Index(@Cast(value="const char*") BytePointer type_key, @Cast(value="unsigned*") int[] out_tindex)
public static int TVMObjectTypeKey2Index(String type_key, @Cast(value="unsigned*") IntPointer out_tindex)
public static int TVMObjectTypeKey2Index(@Cast(value="const char*") BytePointer type_key, @Cast(value="unsigned*") IntBuffer out_tindex)
public static int TVMObjectTypeKey2Index(String type_key, @Cast(value="unsigned*") int[] out_tindex)
public static int TVMObjectTypeIndex2Key(@Cast(value="unsigned") int tindex, @Cast(value="char**") PointerPointer out_type_key)
tindex
- The type index.out_type_key
- The output type key.public static int TVMObjectTypeIndex2Key(@Cast(value="unsigned") int tindex, @Cast(value="char**") @ByPtrPtr BytePointer out_type_key)
public static int TVMObjectTypeIndex2Key(@Cast(value="unsigned") int tindex, @Cast(value="char**") @ByPtrPtr ByteBuffer out_type_key)
public static int TVMObjectTypeIndex2Key(@Cast(value="unsigned") int tindex, @Cast(value="char**") @ByPtrPtr byte[] out_type_key)
public static int TVMObjectRetain(TVMObjectHandle obj)
obj
- The object handle.
\note Internally we increase the reference counter of the object.public static int TVMObjectFree(TVMObjectHandle obj)
obj
- The object handle.
\note Internally we decrease the reference counter of the object.
The object will be freed when every reference to the object are removed.public static int TVMByteArrayFree(TVMByteArray arr)
arr
- The TVMByteArray instance.public static int TVMDeviceAllocDataSpace(@ByVal DLDevice dev, @Cast(value="size_t") long nbytes, @Cast(value="size_t") long alignment, @ByVal DLDataType type_hint, @Cast(value="void**") PointerPointer out_data)
dev
- The device to perform operation.nbytes
- The number of bytes in memory.alignment
- The alignment of the memory.type_hint
- The type of elements. Only needed by certain backends such
as nbytes & alignment are sufficient for most backends.out_data
- The allocated device pointer.public static int TVMDeviceAllocDataSpace(@ByVal DLDevice dev, @Cast(value="size_t") long nbytes, @Cast(value="size_t") long alignment, @ByVal DLDataType type_hint, @Cast(value="void**") @ByPtrPtr Pointer out_data)
public static int TVMDeviceAllocDataSpaceWithScope(@ByVal DLDevice dev, int ndim, @Cast(value="const int64_t*") LongPointer shape, @ByVal DLDataType dtype, @Cast(value="const char*") BytePointer mem_scope, @Cast(value="void**") PointerPointer out_data)
dev
- The device to perform operation.ndim
- The number of dimension of the tensor.shape
- The shape of the tensor.dtype
- The type of elements.mem_scope
- The memory scope of the tensor,
can be nullptr, which indicate the default global DRAMout_data
- The allocated device pointer.public static int TVMDeviceAllocDataSpaceWithScope(@ByVal DLDevice dev, int ndim, @Cast(value="const int64_t*") LongPointer shape, @ByVal DLDataType dtype, @Cast(value="const char*") BytePointer mem_scope, @Cast(value="void**") @ByPtrPtr Pointer out_data)
public static int TVMDeviceAllocDataSpaceWithScope(@ByVal DLDevice dev, int ndim, @Cast(value="const int64_t*") LongBuffer shape, @ByVal DLDataType dtype, String mem_scope, @Cast(value="void**") @ByPtrPtr Pointer out_data)
public static int TVMDeviceAllocDataSpaceWithScope(@ByVal DLDevice dev, int ndim, @Cast(value="const int64_t*") long[] shape, @ByVal DLDataType dtype, @Cast(value="const char*") BytePointer mem_scope, @Cast(value="void**") @ByPtrPtr Pointer out_data)
public static int TVMDeviceAllocDataSpaceWithScope(@ByVal DLDevice dev, int ndim, @Cast(value="const int64_t*") LongPointer shape, @ByVal DLDataType dtype, String mem_scope, @Cast(value="void**") @ByPtrPtr Pointer out_data)
public static int TVMDeviceAllocDataSpaceWithScope(@ByVal DLDevice dev, int ndim, @Cast(value="const int64_t*") LongBuffer shape, @ByVal DLDataType dtype, @Cast(value="const char*") BytePointer mem_scope, @Cast(value="void**") @ByPtrPtr Pointer out_data)
public static int TVMDeviceAllocDataSpaceWithScope(@ByVal DLDevice dev, int ndim, @Cast(value="const int64_t*") long[] shape, @ByVal DLDataType dtype, String mem_scope, @Cast(value="void**") @ByPtrPtr Pointer out_data)
public static int TVMDeviceFreeDataSpace(@ByVal DLDevice dev, Pointer ptr)
dev
- The device to perform operation.ptr
- The data space.public static int TVMDeviceCopyDataFromTo(DLTensor from, DLTensor to, TVMStreamHandle stream)
from
- The source tensor.to
- The target tensor.stream
- Optional stream object.public static int TVMObjectDerivedFrom(@Cast(value="uint32_t") int child_type_index, @Cast(value="uint32_t") int parent_type_index, IntPointer is_derived)
child_type_index
- The type index of the derived type.parent_type_index
- The type index of the parent type.is_derived
- A boolean representing whether this predicate holds.public static int TVMObjectDerivedFrom(@Cast(value="uint32_t") int child_type_index, @Cast(value="uint32_t") int parent_type_index, IntBuffer is_derived)
public static int TVMObjectDerivedFrom(@Cast(value="uint32_t") int child_type_index, @Cast(value="uint32_t") int parent_type_index, int[] is_derived)
@Namespace(value="tvm::runtime") public static int GetVectorBytes(@ByVal DataType dtype)
dtype
- The data type.@Namespace(value="tvm::runtime") @Cast(value="bool") public static boolean TypeMatch(@ByVal DLDataType t, int code, int bits, int lanes)
t
- The typecode
- The type code.bits
- The number of bits to be matched.lanes
- The number of lanes in the type.@Namespace(value="tvm::runtime") @Cast(value="bool") public static boolean TypeMatch(@ByVal DLDataType t, int code, int bits)
@Namespace(value="tvm::runtime") @Cast(value="bool") public static boolean TypeEqual(@ByVal DLDataType lhs, @ByVal DLDataType rhs)
lhs
- The left operand.rhs
- The right operand.@Namespace(value="tvm::runtime") @StdString public static BytePointer GetCustomTypeName(@Cast(value="uint8_t") byte type_code)
type_code
- Custom type code@Namespace(value="tvm::runtime") @Cast(value="bool") public static boolean GetCustomTypeRegistered(@Cast(value="uint8_t") byte type_code)
type_code
- Custom type code@Namespace(value="tvm::runtime") @Cast(value="uint8_t") public static byte ParseCustomDatatype(@StdString BytePointer s, @Cast(value="const char**") PointerPointer scan)
s
- String to parsescan
- pointer to parsing pointer, which is scanning across s@Namespace(value="tvm::runtime") @Cast(value="uint8_t") public static byte ParseCustomDatatype(@StdString BytePointer s, @Cast(value="const char**") @ByPtrPtr BytePointer scan)
@Namespace(value="tvm::runtime") @Cast(value="uint8_t") public static byte ParseCustomDatatype(@StdString String s, @Cast(value="const char**") @ByPtrPtr ByteBuffer scan)
@Namespace(value="tvm::runtime") @Cast(value="uint8_t") public static byte ParseCustomDatatype(@StdString BytePointer s, @Cast(value="const char**") @ByPtrPtr byte[] scan)
@Namespace(value="tvm::runtime") @Cast(value="uint8_t") public static byte ParseCustomDatatype(@StdString String s, @Cast(value="const char**") @ByPtrPtr BytePointer scan)
@Namespace(value="tvm::runtime") @Cast(value="uint8_t") public static byte ParseCustomDatatype(@StdString BytePointer s, @Cast(value="const char**") @ByPtrPtr ByteBuffer scan)
@Namespace(value="tvm::runtime") @Cast(value="uint8_t") public static byte ParseCustomDatatype(@StdString String s, @Cast(value="const char**") @ByPtrPtr byte[] scan)
@Namespace(value="tvm::runtime") @Cast(value="const char*") public static BytePointer DLDataTypeCode2Str(@Cast(value="DLDataTypeCode") int type_code)
type_code
- The type code .@Namespace(value="tvm::runtime") @ByVal public static DLDataType String2DLDataType(@StdString BytePointer s)
s
- The string to be converted.@Namespace(value="tvm::runtime") @ByVal public static DLDataType String2DLDataType(@StdString String s)
@Namespace(value="tvm::runtime") @StdString public static BytePointer DLDataType2String(@ByVal DLDataType t)
t
- The type to be converted.@Namespace(value="tvm::runtime") @Cast(value="std::ostream*") @ByRef @Name(value="operator <<") public static Pointer shiftLeft(@Cast(value="std::ostream*") @ByRef Pointer os, @ByVal DLDataType t)
@Namespace(value="tvm::runtime") @Cast(value="std::ostream*") @ByRef @Name(value="operator <<") public static Pointer shiftLeft(@Cast(value="std::ostream*") @ByRef Pointer os, @Const @ByRef DataType dtype)
@Namespace(value="tvm::runtime") @ByVal @Name(value="make_object<tvm::runtime::ArrayNode>") public static ArrayNodePtr makeArrayNode()
args
- arguments to the constructor.
\tparam T the node type.@Namespace(value="tvm") @MemberGetter @Const @ByRef public static NullOptType NullOpt()
@Namespace(value="tvm::runtime") @Cast(value="std::ostream*") @ByRef @Name(value="operator <<") public static Pointer shiftLeft(@Cast(value="std::ostream*") @ByRef Pointer os, @Const @ByRef ShapeTuple shape)
@Namespace(value="tvm::runtime") @ByVal @Name(value="operator +") public static TVMString add(@Const @ByRef TVMString lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @ByVal @Name(value="operator +") public static TVMString add(@Const @ByRef TVMString lhs, @StdString BytePointer rhs)
@Namespace(value="tvm::runtime") @ByVal @Name(value="operator +") public static TVMString add(@Const @ByRef TVMString lhs, @StdString String rhs)
@Namespace(value="tvm::runtime") @ByVal @Name(value="operator +") public static TVMString add(@StdString BytePointer lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @ByVal @Name(value="operator +") public static TVMString add(@StdString String lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <") public static boolean lessThan(@Const @ByRef TVMString lhs, @StdString BytePointer rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <") public static boolean lessThan(@Const @ByRef TVMString lhs, @StdString String rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <") public static boolean lessThan(@StdString BytePointer lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <") public static boolean lessThan(@StdString String lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <") public static boolean lessThan(@Const @ByRef TVMString lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >") public static boolean greaterThan(@Const @ByRef TVMString lhs, @StdString BytePointer rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >") public static boolean greaterThan(@Const @ByRef TVMString lhs, @StdString String rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >") public static boolean greaterThan(@StdString BytePointer lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >") public static boolean greaterThan(@StdString String lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >") public static boolean greaterThan(@Const @ByRef TVMString lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <=") public static boolean lessThanEquals(@Const @ByRef TVMString lhs, @StdString BytePointer rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <=") public static boolean lessThanEquals(@Const @ByRef TVMString lhs, @StdString String rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <=") public static boolean lessThanEquals(@StdString BytePointer lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <=") public static boolean lessThanEquals(@StdString String lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator <=") public static boolean lessThanEquals(@Const @ByRef TVMString lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >=") public static boolean greaterThanEquals(@Const @ByRef TVMString lhs, @StdString BytePointer rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >=") public static boolean greaterThanEquals(@Const @ByRef TVMString lhs, @StdString String rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >=") public static boolean greaterThanEquals(@StdString BytePointer lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >=") public static boolean greaterThanEquals(@StdString String lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator >=") public static boolean greaterThanEquals(@Const @ByRef TVMString lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator ==") public static boolean equals(@Const @ByRef TVMString lhs, @StdString BytePointer rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator ==") public static boolean equals(@Const @ByRef TVMString lhs, @StdString String rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator ==") public static boolean equals(@StdString BytePointer lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator ==") public static boolean equals(@StdString String lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator ==") public static boolean equals(@Const @ByRef TVMString lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator !=") public static boolean notEquals(@Const @ByRef TVMString lhs, @StdString BytePointer rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator !=") public static boolean notEquals(@Const @ByRef TVMString lhs, @StdString String rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator !=") public static boolean notEquals(@StdString BytePointer lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator !=") public static boolean notEquals(@StdString String lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="bool") @Name(value="operator !=") public static boolean notEquals(@Const @ByRef TVMString lhs, @Const @ByRef TVMString rhs)
@Namespace(value="tvm::runtime") @Cast(value="std::ostream*") @ByRef @Name(value="operator <<") public static Pointer shiftLeft(@Cast(value="std::ostream*") @ByRef Pointer out, @Const @ByRef TVMString input)
@Namespace(value="tvm::runtime") @Cast(value="bool") public static boolean SaveDLTensor(Stream strm, @Const DLTensor tensor)
strm
- The output streamtensor
- The tensor to be saved.@Namespace(value="tvm::runtime") @Cast(value="size_t") public static long GetDataSize(@Const @ByRef DLTensor arr)
arr
- the input DLTensor@Namespace(value="tvm::runtime") @Cast(value="bool") public static boolean IsContiguous(@Const @ByRef DLTensor arr)
arr
- The input DLTensor.@Namespace(value="tvm::runtime") public static TVMObject TVMArrayHandleToObjectHandle(@Cast(value="TVMArrayHandle") DLTensor handle)
@Namespace(value="tvm::runtime") @MemberGetter @Cast(value="const uint64_t") public static long kTVMNDArrayMagic()
@Namespace(value="tvm::runtime") @ByVal @Cast(value="tvm::Device*") public static DLDevice GetPreferredHostDevice(@ByVal @Cast(value="tvm::Device*") DLDevice device)
@Namespace(value="tvm::runtime") @Cast(value="bool") public static boolean RuntimeEnabled(@Const @ByRef TVMString target)
target
- The target module name.@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_get_c_metadata()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_module_ctx()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_dev_mblob()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_set_device()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_global_barrier_state()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_prepare_global_barrier()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_module_main()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_param_prefix()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_lookup_linked_param()
@Namespace(value="tvm::runtime::symbol") @MemberGetter @Cast(value="const char*") public static BytePointer tvm_entrypoint_suffix()
@Namespace(value="tvm::runtime") @Cast(value="std::ostream*") @ByRef @Name(value="operator <<") public static Pointer shiftLeft(@Cast(value="std::ostream*") @ByRef Pointer out, @Const @ByRef Module module)
@Namespace(value="tvm::runtime") @Cast(value="const char*") public static BytePointer ArgTypeCode2Str(int type_code)
type_code
- The input type code.@Namespace(value="tvm::runtime") @Cast(value="const char*") public static BytePointer DLDeviceType2Str(int type)
type
- The device type.@Namespace(value="tvm::runtime") public static void EnvCheckSignals()
int check_signal_every_k_iter = 10;
for (int iter = 0; iter < very_large_number; ++iter) {
if (iter % check_signal_every_k_iter == 0) {
tvm::runtime::EnvCheckSignals();
}
// do work here
}
\note This function is a nop when no PyErr_CheckSignals is registered.This
- function throws an exception when the frontend signal handler
indicate an error happens, otherwise it returns normally.Copyright © 2024. All rights reserved.