42 #ifndef DLPACK_DLPACK_H_
43 #define DLPACK_DLPACK_H_
46 #define DLPACK_EXTERN_C extern "C"
48 #define DLPACK_EXTERN_C
52 #define DLPACK_VERSION 020
57 #define DLPACK_DLL __declspec(dllexport)
59 #define DLPACK_DLL __declspec(dllimport)
DLDataTypeCode
The type code options DLDataType.
Definition: DLPack.h:115
@ kDLInt
Definition: DLPack.h:116
@ kDLBfloat
Definition: DLPack.h:119
@ kDLFloat
Definition: DLPack.h:118
@ kDLUInt
Definition: DLPack.h:117
DLDeviceType
The device type in DLContext.
Definition: DLPack.h:74
@ kDLVulkan
Vulkan buffer for next generation graphics.
Definition: DLPack.h:87
@ kDLMetal
Metal for Apple GPU.
Definition: DLPack.h:89
@ kDLCPUPinned
Pinned CUDA GPU device by cudaMallocHost.
Definition: DLPack.h:83
@ kDLOpenCL
OpenCL devices.
Definition: DLPack.h:85
@ kDLCPU
CPU device.
Definition: DLPack.h:76
@ kDLROCM
ROCm GPUs for AMD GPUs.
Definition: DLPack.h:93
@ kDLGPU
CUDA GPU device.
Definition: DLPack.h:78
@ kDLExtDev
Reserved extension device type, used for quickly test extension device The semantics can differ depen...
Definition: DLPack.h:99
@ kDLVPI
Verilog simulator buffer.
Definition: DLPack.h:91
struct DLManagedTensor DLManagedTensor
C Tensor object, manage memory of DLTensor. This data structure is intended to facilitate the borrowi...
const char const char value recording_handle imu_sample void
Definition: K4aPlugin.cpp:269
const char const char value recording_handle imu_sample recording_handle uint8_t size_t data_size k4a_record_configuration_t config target_format k4a_capture_t capture_handle k4a_imu_sample_t imu_sample uint64_t
Definition: K4aPlugin.cpp:362
A Device context for Tensor and operator.
Definition: DLPack.h:105
int device_id
The device index.
Definition: DLPack.h:109
DLDeviceType device_type
The device type used in the device.
Definition: DLPack.h:107
The data type the tensor can hold.
Definition: DLPack.h:130
uint16_t lanes
Number of lanes in the type, used for vector types.
Definition: DLPack.h:142
uint8_t bits
Number of bits, common choices are 8, 16, 32.
Definition: DLPack.h:140
uint8_t code
Type code of base types. We keep it uint8_t instead of DLDataTypeCode for minimal memory footprint,...
Definition: DLPack.h:136
C Tensor object, manage memory of DLTensor. This data structure is intended to facilitate the borrowi...
Definition: DLPack.h:193
void(* deleter)(struct DLManagedTensor *self)
Destructor signature void (*)(void*) - this should be called to destruct manager_ctx which holds the ...
Definition: DLPack.h:205
DLTensor dl_tensor
DLTensor which is being memory managed.
Definition: DLPack.h:195
void * manager_ctx
the context of the original host framework of DLManagedTensor in which DLManagedTensor is used in the...
Definition: DLPack.h:199
Plain C Tensor object, does not manage memory.
Definition: DLPack.h:148
int64_t * strides
strides of the tensor (in number of elements, not bytes) can be NULL, indicating tensor is compact an...
Definition: DLPack.h:181
DLContext ctx
The device context of the tensor.
Definition: DLPack.h:170
uint64_t byte_offset
The offset in bytes to the beginning pointer to data.
Definition: DLPack.h:183
void * data
The opaque data pointer points to the allocated data. This will be CUDA device pointer or cl_mem hand...
Definition: DLPack.h:168
int64_t * shape
The shape of the tensor.
Definition: DLPack.h:176
int ndim
Number of dimensions.
Definition: DLPack.h:172
DLDataType dtype
The data type of the pointer.
Definition: DLPack.h:174