6 #ifndef DLPACK_DLPACK_H_ 7 #define DLPACK_DLPACK_H_ 10 #define DLPACK_EXTERN_C extern "C" 12 #define DLPACK_EXTERN_C 16 #define DLPACK_VERSION 010 21 #define DLPACK_DLL __declspec(dllexport) 23 #define DLPACK_DLL __declspec(dllimport) 141 #endif // DLPACK_DLPACK_H_ C Tensor object, manage memory of DLTensor. This data structure is intended to faciliate the borrowin...
int64_t * shape
The shape of the tensor.
void * manager_ctx
the context of the original host framework of DLManagedTensor in which DLManagedTensor is used in the...
uint16_t lanes
Number of lanes in the type, used for vector types.
int device_id
The device index.
DLDataType dtype
The data type of the pointer.
int64_t * strides
strides of the tensor, can be NULL, indicating tensor is compact.
struct DLManagedTensor DLManagedTensor
C Tensor object, manage memory of DLTensor. This data structure is intended to faciliate the borrowin...
int ndim
Number of dimensions.
void * data
The opaque data pointer points to the allocated data. This will be CUDA device pointer or cl_mem hand...
A Device context for Tensor and operator.
DLDeviceType device_type
The device type used in the device.
uint8_t bits
Number of bits, common choices are 8, 16, 32.
DLDeviceType
The device type in DLContext.
DLTensor dl_tensor
DLTensor which is being memory managed.
DLDataTypeCode
The type code options DLDataType.
uint64_t byte_offset
The offset in bytes to the beginning pointer to data.
DLContext ctx
The device context of the tensor.
The data type the tensor can hold.
uint8_t code
Type code of base types. We keep it uint8_t instead of DLDataTypeCode for minimal memory footprint...
void(* deleter)(struct DLManagedTensor *self)
Destructor signature void (*)(void*) - this should be called to destruct manager_ctx which holds the ...
Plain C Tensor object, does not manage memory.