Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 31 additions & 1 deletion python/tvm_ffi/cython/base.pxi
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,8 @@ cdef extern from "tvm/ffi/c_api.h":
void (*update_backtrace)(
TVMFFIObjectHandle self, const TVMFFIByteArray* backtrace, int32_t update_mode
)
TVMFFIObjectHandle cause_chain
TVMFFIObjectHandle extra_context

ctypedef int (*TVMFFISafeCallType)(
void* handle, const TVMFFIAny* args, int32_t num_args,
Expand All @@ -204,7 +206,12 @@ cdef extern from "tvm/ffi/c_api.h":
kTVMFFIFieldFlagBitMaskWritable = 1 << 0
kTVMFFIFieldFlagBitMaskHasDefault = 1 << 1
kTVMFFIFieldFlagBitMaskIsStaticMethod = 1 << 2
kTVMFFIFieldFlagBitMaskSEqHashIgnore = 1 << 3
kTVMFFIFieldFlagBitMaskSEqHashDef = 1 << 4
kTVMFFIFieldFlagBitMaskDefaultFromFactory = 1 << 5
kTVMFFIFieldFlagBitMaskReprOff = 1 << 6
kTVMFFIFieldFlagBitMaskCompareOff = 1 << 7
kTVMFFIFieldFlagBitMaskHashOff = 1 << 8
kTVMFFIFieldFlagBitMaskInitOff = 1 << 9
kTVMFFIFieldFlagBitMaskKwOnly = 1 << 10
kTVMFFIFieldFlagBitSetterIsFunctionObj = 1 << 11
Expand Down Expand Up @@ -233,10 +240,19 @@ cdef extern from "tvm/ffi/c_api.h":
int64_t flags
TVMFFIAny method

cdef enum TVMFFISEqHashKind:
kTVMFFISEqHashKindUnsupported = 0
kTVMFFISEqHashKindTreeNode = 1
kTVMFFISEqHashKindFreeVar = 2
kTVMFFISEqHashKindDAGNode = 3
kTVMFFISEqHashKindConstTreeNode = 4
kTVMFFISEqHashKindUniqueInstance = 5

ctypedef struct TVMFFITypeMetadata:
TVMFFIByteArray doc
TVMFFIObjectCreator creator
int64_t total_size
int32_t total_size
TVMFFISEqHashKind structural_eq_hash_kind

ctypedef struct TVMFFITypeInfo:
int32_t type_index
Expand Down Expand Up @@ -298,6 +314,20 @@ cdef extern from "tvm/ffi/c_api.h":
DLDevice TVMFFIDLDeviceFromIntPair(int32_t device_type, int32_t device_id) nogil
const TVMFFITypeAttrColumn* TVMFFIGetTypeAttrColumn(const TVMFFIByteArray* attr_name) nogil

int32_t TVMFFITypeGetOrAllocIndex(
const TVMFFIByteArray* type_key,
int32_t static_type_index,
int32_t type_depth,
int32_t num_child_slots,
int32_t child_slots_can_overflow,
int32_t parent_type_index
) nogil
int TVMFFITypeRegisterField(int32_t type_index, const TVMFFIFieldInfo* info) nogil
int TVMFFITypeRegisterMetadata(int32_t type_index, const TVMFFITypeMetadata* metadata) nogil
int TVMFFITypeRegisterAttr(int32_t type_index, const TVMFFIByteArray* attr_name,
const TVMFFIAny* attr_value) nogil
void TVMFFIErrorSetRaisedFromCStr(const char* kind, const char* message) nogil

cdef extern from "tvm/ffi/extra/c_env_api.h":
ctypedef void* TVMFFIStreamHandle

Expand Down
Loading