PandA-2024.02
Data Structures | Macros | Typedefs | Enumerations
dlpack.h File Reference

The common header of DLPack. More...

#include <stdint.h>
#include <stddef.h>
Include dependency graph for dlpack.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  DLContext
 A Device context for Tensor and operator. More...
 
struct  DLDataType
 The data type the tensor can hold. More...
 
struct  DLTensor
 Plain C Tensor object, does not manage memory. More...
 
struct  DLManagedTensor
 C Tensor object, manage memory of DLTensor. This data structure is intended to faciliate the borrowing of DLTensor by another framework. It is not meant to transfer the tensor. When the borrowing framework doesn't need the tensor, it should call the deleter to notify the host that the resource is no longer needed. More...
 

Macros

#define DLPACK_EXTERN_C
 
#define DLPACK_VERSION   020
 The current version of dlpack. More...
 
#define DLPACK_DLL
 DLPACK_DLL prefix for windows. More...
 

Typedefs

typedef struct DLManagedTensor DLManagedTensor
 C Tensor object, manage memory of DLTensor. This data structure is intended to faciliate the borrowing of DLTensor by another framework. It is not meant to transfer the tensor. When the borrowing framework doesn't need the tensor, it should call the deleter to notify the host that the resource is no longer needed. More...
 

Enumerations

enum  DLDeviceType {
  kDLCPU = 1, kDLGPU = 2, kDLCPUPinned = 3, kDLOpenCL = 4,
  kDLVulkan = 7, kDLMetal = 8, kDLVPI = 9, kDLROCM = 10,
  kDLExtDev = 12
}
 The device type in DLContext. More...
 
enum  DLDataTypeCode { kDLInt = 0U, kDLUInt = 1U, kDLFloat = 2U }
 The type code options DLDataType. More...
 

Detailed Description

The common header of DLPack.

Copyright (c) 2017 by Contributors

Definition in file dlpack.h.

Macro Definition Documentation

◆ DLPACK_DLL

#define DLPACK_DLL

DLPACK_DLL prefix for windows.

Definition at line 26 of file dlpack.h.

◆ DLPACK_EXTERN_C

#define DLPACK_EXTERN_C

Definition at line 12 of file dlpack.h.

◆ DLPACK_VERSION

#define DLPACK_VERSION   020

The current version of dlpack.

Definition at line 16 of file dlpack.h.

Typedef Documentation

◆ DLManagedTensor

C Tensor object, manage memory of DLTensor. This data structure is intended to faciliate the borrowing of DLTensor by another framework. It is not meant to transfer the tensor. When the borrowing framework doesn't need the tensor, it should call the deleter to notify the host that the resource is no longer needed.

Enumeration Type Documentation

◆ DLDataTypeCode

The type code options DLDataType.

Enumerator
kDLInt 
kDLUInt 
kDLFloat 

Definition at line 79 of file dlpack.h.

◆ DLDeviceType

The device type in DLContext.

Enumerator
kDLCPU 

CPU device.

kDLGPU 

CUDA GPU device.

kDLCPUPinned 

Pinned CUDA GPU device by cudaMallocHost.

Note
kDLCPUPinned = kDLCPU | kDLGPU
kDLOpenCL 

OpenCL devices.

kDLVulkan 

Vulkan buffer for next generation graphics.

kDLMetal 

Metal for Apple GPU.

kDLVPI 

Verilog simulator buffer.

kDLROCM 

ROCm GPUs for AMD GPUs.

kDLExtDev 

Reserved extension device type, used for quickly test extension device The semantics can differ depending on the implementation.

Definition at line 38 of file dlpack.h.


Generated on Mon Feb 12 2024 13:03:11 for PandA-2024.02 by doxygen 1.8.13