pub const TVM_VERSION: &'static [u8; 8usize] = b"0.5.dev\0";
pub const DLPACK_VERSION: u32 = 8;
pub const _STDINT_H: u32 = 1;
pub const _FEATURES_H: u32 = 1;
pub const _DEFAULT_SOURCE: u32 = 1;
pub const __USE_ISOC11: u32 = 1;
pub const __USE_ISOC99: u32 = 1;
pub const __USE_ISOC95: u32 = 1;
pub const __USE_POSIX_IMPLICITLY: u32 = 1;
pub const _POSIX_SOURCE: u32 = 1;
pub const _POSIX_C_SOURCE: u32 = 200809;
pub const __USE_POSIX: u32 = 1;
pub const __USE_POSIX2: u32 = 1;
pub const __USE_POSIX199309: u32 = 1;
pub const __USE_POSIX199506: u32 = 1;
pub const __USE_XOPEN2K: u32 = 1;
pub const __USE_XOPEN2K8: u32 = 1;
pub const _ATFILE_SOURCE: u32 = 1;
pub const __USE_MISC: u32 = 1;
pub const __USE_ATFILE: u32 = 1;
pub const __USE_FORTIFY_LEVEL: u32 = 0;
pub const _STDC_PREDEF_H: u32 = 1;
pub const __STDC_IEC_559__: u32 = 1;
pub const __STDC_IEC_559_COMPLEX__: u32 = 1;
pub const __STDC_ISO_10646__: u32 = 201505;
pub const __STDC_NO_THREADS__: u32 = 1;
pub const __GNU_LIBRARY__: u32 = 6;
pub const __GLIBC__: u32 = 2;
pub const __GLIBC_MINOR__: u32 = 23;
pub const _SYS_CDEFS_H: u32 = 1;
pub const __WORDSIZE: u32 = 64;
pub const __WORDSIZE_TIME64_COMPAT32: u32 = 1;
pub const __SYSCALL_WORDSIZE: u32 = 64;
pub const _BITS_WCHAR_H: u32 = 1;
pub const INT8_MIN: i32 = -128;
pub const INT16_MIN: i32 = -32768;
pub const INT32_MIN: i32 = -2147483648;
pub const INT8_MAX: u32 = 127;
pub const INT16_MAX: u32 = 32767;
pub const INT32_MAX: u32 = 2147483647;
pub const UINT8_MAX: u32 = 255;
pub const UINT16_MAX: u32 = 65535;
pub const UINT32_MAX: u32 = 4294967295;
pub const INT_LEAST8_MIN: i32 = -128;
pub const INT_LEAST16_MIN: i32 = -32768;
pub const INT_LEAST32_MIN: i32 = -2147483648;
pub const INT_LEAST8_MAX: u32 = 127;
pub const INT_LEAST16_MAX: u32 = 32767;
pub const INT_LEAST32_MAX: u32 = 2147483647;
pub const UINT_LEAST8_MAX: u32 = 255;
pub const UINT_LEAST16_MAX: u32 = 65535;
pub const UINT_LEAST32_MAX: u32 = 4294967295;
pub const INT_FAST8_MIN: i32 = -128;
pub const INT_FAST16_MIN: i64 = -9223372036854775808;
pub const INT_FAST32_MIN: i64 = -9223372036854775808;
pub const INT_FAST8_MAX: u32 = 127;
pub const INT_FAST16_MAX: u64 = 9223372036854775807;
pub const INT_FAST32_MAX: u64 = 9223372036854775807;
pub const UINT_FAST8_MAX: u32 = 255;
pub const UINT_FAST16_MAX: i32 = -1;
pub const UINT_FAST32_MAX: i32 = -1;
pub const INTPTR_MIN: i64 = -9223372036854775808;
pub const INTPTR_MAX: u64 = 9223372036854775807;
pub const UINTPTR_MAX: i32 = -1;
pub const PTRDIFF_MIN: i64 = -9223372036854775808;
pub const PTRDIFF_MAX: u64 = 9223372036854775807;
pub const SIG_ATOMIC_MIN: i32 = -2147483648;
pub const SIG_ATOMIC_MAX: u32 = 2147483647;
pub const SIZE_MAX: i32 = -1;
pub const WINT_MIN: u32 = 0;
pub const WINT_MAX: u32 = 4294967295;
pub type int_least8_t = ::std::os::raw::c_schar;
pub type int_least16_t = ::std::os::raw::c_short;
pub type int_least32_t = ::std::os::raw::c_int;
pub type int_least64_t = ::std::os::raw::c_long;
pub type uint_least8_t = ::std::os::raw::c_uchar;
pub type uint_least16_t = ::std::os::raw::c_ushort;
pub type uint_least32_t = ::std::os::raw::c_uint;
pub type uint_least64_t = ::std::os::raw::c_ulong;
pub type int_fast8_t = ::std::os::raw::c_schar;
pub type int_fast16_t = ::std::os::raw::c_long;
pub type int_fast32_t = ::std::os::raw::c_long;
pub type int_fast64_t = ::std::os::raw::c_long;
pub type uint_fast8_t = ::std::os::raw::c_uchar;
pub type uint_fast16_t = ::std::os::raw::c_ulong;
pub type uint_fast32_t = ::std::os::raw::c_ulong;
pub type uint_fast64_t = ::std::os::raw::c_ulong;
pub type intmax_t = ::std::os::raw::c_long;
pub type uintmax_t = ::std::os::raw::c_ulong;
pub type wchar_t = ::std::os::raw::c_int;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct max_align_t {
pub __clang_max_align_nonce1: ::std::os::raw::c_longlong,
pub __bindgen_padding_0: u64,
pub __clang_max_align_nonce2: f64,
}
pub const DLDeviceType_kDLCPU: DLDeviceType = 1;
pub const DLDeviceType_kDLGPU: DLDeviceType = 2;
pub const DLDeviceType_kDLCPUPinned: DLDeviceType = 3;
pub const DLDeviceType_kDLOpenCL: DLDeviceType = 4;
pub const DLDeviceType_kDLMetal: DLDeviceType = 8;
pub const DLDeviceType_kDLVPI: DLDeviceType = 9;
pub const DLDeviceType_kDLROCM: DLDeviceType = 10;
pub type DLDeviceType = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DLContext {
pub device_type: DLDeviceType,
pub device_id: ::std::os::raw::c_int,
}
pub const DLDataTypeCode_kDLInt: DLDataTypeCode = 0;
pub const DLDataTypeCode_kDLUInt: DLDataTypeCode = 1;
pub const DLDataTypeCode_kDLFloat: DLDataTypeCode = 2;
pub type DLDataTypeCode = u32;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DLDataType {
pub code: u8,
pub bits: u8,
pub lanes: u16,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DLTensor {
pub data: *mut ::std::os::raw::c_void,
pub ctx: DLContext,
pub ndim: ::std::os::raw::c_int,
pub dtype: DLDataType,
pub shape: *mut i64,
pub strides: *mut i64,
pub byte_offset: u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct DLManagedTensor {
pub dl_tensor: DLTensor,
pub manager_ctx: *mut ::std::os::raw::c_void,
pub deleter: ::std::option::Option<unsafe extern "C" fn(self_: *mut DLManagedTensor)>,
}
pub type tvm_index_t = i64;
pub const TVMDeviceExtType_kDLAOCL: TVMDeviceExtType = 5;
pub const TVMDeviceExtType_kDLSDAccel: TVMDeviceExtType = 6;
pub const TVMDeviceExtType_kDLVulkan: TVMDeviceExtType = 7;
pub const TVMDeviceExtType_kOpenGL: TVMDeviceExtType = 11;
pub const TVMDeviceExtType_kExtDev: TVMDeviceExtType = 12;
pub type TVMDeviceExtType = u32;
pub const TVMTypeCode_kHandle: TVMTypeCode = 3;
pub const TVMTypeCode_kNull: TVMTypeCode = 4;
pub const TVMTypeCode_kTVMType: TVMTypeCode = 5;
pub const TVMTypeCode_kTVMContext: TVMTypeCode = 6;
pub const TVMTypeCode_kArrayHandle: TVMTypeCode = 7;
pub const TVMTypeCode_kNodeHandle: TVMTypeCode = 8;
pub const TVMTypeCode_kModuleHandle: TVMTypeCode = 9;
pub const TVMTypeCode_kFuncHandle: TVMTypeCode = 10;
pub const TVMTypeCode_kStr: TVMTypeCode = 11;
pub const TVMTypeCode_kBytes: TVMTypeCode = 12;
pub const TVMTypeCode_kNDArrayContainer: TVMTypeCode = 13;
pub const TVMTypeCode_kExtBegin: TVMTypeCode = 15;
pub const TVMTypeCode_kNNVMFirst: TVMTypeCode = 16;
pub const TVMTypeCode_kNNVMLast: TVMTypeCode = 20;
pub const TVMTypeCode_kExtReserveEnd: TVMTypeCode = 64;
pub const TVMTypeCode_kExtEnd: TVMTypeCode = 128;
pub type TVMTypeCode = u32;
pub type TVMType = DLDataType;
pub type TVMContext = DLContext;
pub type TVMArray = DLTensor;
pub type TVMArrayHandle = *mut TVMArray;
#[repr(C)]
#[derive(Copy, Clone)]
pub union TVMValue {
pub v_int64: i64,
pub v_float64: f64,
pub v_handle: *mut ::std::os::raw::c_void,
pub v_str: *const ::std::os::raw::c_char,
pub v_type: TVMType,
pub v_ctx: TVMContext,
_bindgen_union_align: u64,
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TVMByteArray {
pub data: *const ::std::os::raw::c_char,
pub size: usize,
}
pub type TVMModuleHandle = *mut ::std::os::raw::c_void;
pub type TVMFunctionHandle = *mut ::std::os::raw::c_void;
pub type TVMRetValueHandle = *mut ::std::os::raw::c_void;
pub type TVMStreamHandle = *mut ::std::os::raw::c_void;
extern "C" {
pub fn TVMAPISetLastError(msg: *const ::std::os::raw::c_char);
}
extern "C" {
pub fn TVMGetLastError() -> *const ::std::os::raw::c_char;
}
extern "C" {
pub fn TVMModLoadFromFile(
file_name: *const ::std::os::raw::c_char,
format: *const ::std::os::raw::c_char,
out: *mut TVMModuleHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMModImport(mod_: TVMModuleHandle, dep: TVMModuleHandle) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMModGetFunction(
mod_: TVMModuleHandle,
func_name: *const ::std::os::raw::c_char,
query_imports: ::std::os::raw::c_int,
out: *mut TVMFunctionHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMExtTypeFree(
handle: *mut ::std::os::raw::c_void,
type_code: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMModFree(mod_: TVMModuleHandle) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMFuncFree(func: TVMFunctionHandle) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMFuncCall(
func: TVMFunctionHandle,
arg_values: *mut TVMValue,
type_codes: *mut ::std::os::raw::c_int,
num_args: ::std::os::raw::c_int,
ret_val: *mut TVMValue,
ret_type_code: *mut ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMCFuncSetReturn(
ret: TVMRetValueHandle,
value: *mut TVMValue,
type_code: *mut ::std::os::raw::c_int,
num_ret: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMCbArgToReturn(
value: *mut TVMValue,
code: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
pub type TVMPackedCFunc = ::std::option::Option<
unsafe extern "C" fn(
args: *mut TVMValue,
type_codes: *mut ::std::os::raw::c_int,
num_args: ::std::os::raw::c_int,
ret: TVMRetValueHandle,
resource_handle: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>;
pub type TVMPackedCFuncFinalizer =
::std::option::Option<unsafe extern "C" fn(resource_handle: *mut ::std::os::raw::c_void)>;
pub type TVMExtensionFuncDeclarer = ::std::option::Option<
unsafe extern "C" fn(register_func_handle: TVMFunctionHandle) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn TVMFuncCreateFromCFunc(
func: TVMPackedCFunc,
resource_handle: *mut ::std::os::raw::c_void,
fin: TVMPackedCFuncFinalizer,
out: *mut TVMFunctionHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMFuncRegisterGlobal(
name: *const ::std::os::raw::c_char,
f: TVMFunctionHandle,
override_: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMFuncGetGlobal(
name: *const ::std::os::raw::c_char,
out: *mut TVMFunctionHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMFuncListGlobalNames(
out_size: *mut ::std::os::raw::c_int,
out_array: *mut *mut *const ::std::os::raw::c_char,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMArrayAlloc(
shape: *const tvm_index_t,
ndim: ::std::os::raw::c_int,
dtype_code: ::std::os::raw::c_int,
dtype_bits: ::std::os::raw::c_int,
dtype_lanes: ::std::os::raw::c_int,
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
out: *mut TVMArrayHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMArrayFree(handle: TVMArrayHandle) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMArrayCopyFromBytes(
handle: TVMArrayHandle,
data: *mut ::std::os::raw::c_void,
nbytes: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMArrayCopyToBytes(
handle: TVMArrayHandle,
data: *mut ::std::os::raw::c_void,
nbytes: usize,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMArrayCopyFromTo(
from: TVMArrayHandle,
to: TVMArrayHandle,
stream: TVMStreamHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMArrayFromDLPack(
from: *mut DLManagedTensor,
out: *mut TVMArrayHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMArrayToDLPack(
from: TVMArrayHandle,
out: *mut *mut DLManagedTensor,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMDLManagedTensorCallDeleter(dltensor: *mut DLManagedTensor);
}
extern "C" {
pub fn TVMStreamCreate(
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
out: *mut TVMStreamHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMStreamFree(
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
stream: TVMStreamHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMSetStream(
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
handle: TVMStreamHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMSynchronize(
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
stream: TVMStreamHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMStreamStreamSynchronize(
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
src: TVMStreamHandle,
dst: TVMStreamHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMBackendGetFuncFromEnv(
mod_node: *mut ::std::os::raw::c_void,
func_name: *const ::std::os::raw::c_char,
out: *mut TVMFunctionHandle,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMBackendRegisterSystemLibSymbol(
name: *const ::std::os::raw::c_char,
ptr: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMBackendAllocWorkspace(
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
nbytes: u64,
dtype_code_hint: ::std::os::raw::c_int,
dtype_bits_hint: ::std::os::raw::c_int,
) -> *mut ::std::os::raw::c_void;
}
extern "C" {
pub fn TVMBackendFreeWorkspace(
device_type: ::std::os::raw::c_int,
device_id: ::std::os::raw::c_int,
ptr: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int;
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct TVMParallelGroupEnv {
pub sync_handle: *mut ::std::os::raw::c_void,
pub num_task: i32,
}
pub type FTVMParallelLambda = ::std::option::Option<
unsafe extern "C" fn(
task_id: ::std::os::raw::c_int,
penv: *mut TVMParallelGroupEnv,
cdata: *mut ::std::os::raw::c_void,
) -> ::std::os::raw::c_int,
>;
extern "C" {
pub fn TVMBackendParallelLaunch(
flambda: FTVMParallelLambda,
cdata: *mut ::std::os::raw::c_void,
num_task: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMBackendParallelBarrier(
task_id: ::std::os::raw::c_int,
penv: *mut TVMParallelGroupEnv,
) -> ::std::os::raw::c_int;
}
extern "C" {
pub fn TVMBackendRunOnce(
handle: *mut *mut ::std::os::raw::c_void,
f: ::std::option::Option<
unsafe extern "C" fn(arg1: *mut ::std::os::raw::c_void) -> ::std::os::raw::c_int,
>,
cdata: *mut ::std::os::raw::c_void,
nbytes: ::std::os::raw::c_int,
) -> ::std::os::raw::c_int;
}