Go to the documentation of this file.
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 020
21 #define DLPACK_DLL __declspec(dllexport)
23 #define DLPACK_DLL __declspec(dllimport)
174 #endif // DLPACK_DLPACK_H_
@ kDLFloat
Definition: dlpack.h:82
The data type the tensor can hold.
Definition: dlpack.h:94
DLTensor dl_tensor
DLTensor which is being memory managed.
Definition: dlpack.h:159
void * data
The opaque data pointer points to the allocated data. This will be CUDA device pointer or cl_mem hand...
Definition: dlpack.h:132
@ kDLOpenCL
OpenCL devices.
Definition: dlpack.h:49
DLDeviceType device_type
The device type used in the device.
Definition: dlpack.h:71
@ kDLVPI
Verilog simulator buffer.
Definition: dlpack.h:55
int ndim
Number of dimensions.
Definition: dlpack.h:136
A Device context for Tensor and operator.
Definition: dlpack.h:69
@ kDLCPU
CPU device.
Definition: dlpack.h:40
uint64_t byte_offset
The offset in bytes to the beginning pointer to data.
Definition: dlpack.h:147
@ kDLROCM
ROCm GPUs for AMD GPUs.
Definition: dlpack.h:57
struct DLManagedTensor DLManagedTensor
C Tensor object, manage memory of DLTensor. This data structure is intended to facilitate the borrowi...
DLDeviceType
The device type in DLContext.
Definition: dlpack.h:38
C Tensor object, manage memory of DLTensor. This data structure is intended to facilitate the borrowi...
Definition: dlpack.h:157
@ kDLMetal
Metal for Apple GPU.
Definition: dlpack.h:53
void * manager_ctx
the context of the original host framework of DLManagedTensor in which DLManagedTensor is used in the...
Definition: dlpack.h:163
int64_t * strides
strides of the tensor (in number of elements, not bytes) can be NULL, indicating tensor is compact an...
Definition: dlpack.h:145
@ kDLGPU
CUDA GPU device.
Definition: dlpack.h:42
uint8_t code
Type code of base types. We keep it uint8_t instead of DLDataTypeCode for minimal memory footprint,...
Definition: dlpack.h:100
@ kDLVulkan
Vulkan buffer for next generation graphics.
Definition: dlpack.h:51
uint8_t bits
Number of bits, common choices are 8, 16, 32.
Definition: dlpack.h:104
@ kDLInt
Definition: dlpack.h:80
DLContext ctx
The device context of the tensor.
Definition: dlpack.h:134
DLDataType dtype
The data type of the pointer.
Definition: dlpack.h:138
@ kDLUInt
Definition: dlpack.h:81
@ kDLCPUPinned
Pinned CUDA GPU device by cudaMallocHost.
Definition: dlpack.h:47
int64_t * shape
The shape of the tensor.
Definition: dlpack.h:140
void(* deleter)(struct DLManagedTensor *self)
Destructor signature void (*)(void*) - this should be called to destruct manager_ctx which holds the ...
Definition: dlpack.h:169
int device_id
The device index.
Definition: dlpack.h:73
@ kDLExtDev
Reserved extension device type, used for quickly test extension device The semantics can differ depen...
Definition: dlpack.h:63
uint16_t lanes
Number of lanes in the type, used for vector types.
Definition: dlpack.h:106
Plain C Tensor object, does not manage memory.
Definition: dlpack.h:112
DLDataTypeCode
The type code options DLDataType.
Definition: dlpack.h:79
@ kDLBfloat
Definition: dlpack.h:83