Skip to content

Commit 56b6ee6

Browse files
Updated dlpack.h and companion README.md documenting provenance
1 parent 45db6ea commit 56b6ee6

File tree

2 files changed

+22
-6
lines changed

2 files changed

+22
-6
lines changed

dpctl/tensor/include/dlpack/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# DLPack header
22

3-
The header `dlpack.h` downloaded from `https://github.com/dmlc/dlpack.git` remote at commit [`98861a50e5`](https://github.com/dmlc/dlpack/commit/98861a50e5ade5a6b2df388b12d67b418e3baebe).
3+
The header `dlpack.h` downloaded from `https://github.com/dmlc/dlpack.git` remote at tag 0.7 commit [`e2bdd3bee8`](https://github.com/dmlc/dlpack/commit/e2bdd3bee8cb6501558042633fa59144cc8b7f5f).
44

5-
The file can also be viewed using github web interface at https://github.com/dmlc/dlpack/blob/98861a50e5ade5a6b2df388b12d67b418e3baebe/include/dlpack/dlpack.h
5+
The file can also be viewed using github web interface at https://github.com/dmlc/dlpack/blob/e2bdd3bee8cb6501558042633fa59144cc8b7f5f/include/dlpack/dlpack.h
66

77
License file was retrived from https://github.com/dmlc/dlpack/blob/main/LICENSE

dpctl/tensor/include/dlpack/dlpack.h

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,20 @@
66
#ifndef DLPACK_DLPACK_H_
77
#define DLPACK_DLPACK_H_
88

9+
/**
10+
* \brief Compatibility with C++
11+
*/
912
#ifdef __cplusplus
1013
#define DLPACK_EXTERN_C extern "C"
1114
#else
1215
#define DLPACK_EXTERN_C
1316
#endif
1417

1518
/*! \brief The current version of dlpack */
16-
#define DLPACK_VERSION 60
19+
#define DLPACK_VERSION 70
20+
21+
/*! \brief The current ABI version of dlpack */
22+
#define DLPACK_ABI_VERSION 1
1723

1824
/*! \brief DLPACK_DLL prefix for windows */
1925
#ifdef _WIN32
@@ -35,7 +41,11 @@ extern "C" {
3541
/*!
3642
* \brief The device type in DLDevice.
3743
*/
44+
#ifdef __cplusplus
45+
typedef enum : int32_t {
46+
#else
3847
typedef enum {
48+
#endif
3949
/*! \brief CPU device */
4050
kDLCPU = 1,
4151
/*! \brief CUDA GPU device */
@@ -75,6 +85,10 @@ typedef enum {
7585
*
7686
*/
7787
kDLOneAPI = 14,
88+
/*! \brief GPU support for next generation WebGPU standard. */
89+
kDLWebGPU = 15,
90+
/*! \brief Qualcomm Hexagon DSP */
91+
kDLHexagon = 16,
7892
} DLDeviceType;
7993

8094
/*!
@@ -87,7 +101,7 @@ typedef struct {
87101
* \brief The device index.
88102
* For vanilla CPU memory, pinned memory, or managed memory, this is set to 0.
89103
*/
90-
int device_id;
104+
int32_t device_id;
91105
} DLDevice;
92106

93107
/*!
@@ -115,7 +129,9 @@ typedef enum {
115129
} DLDataTypeCode;
116130

117131
/*!
118-
* \brief The data type the tensor can hold.
132+
* \brief The data type the tensor can hold. The data type is assumed to follow the
133+
* native endian-ness. An explicit error message should be raised when attempting to
134+
* export an array with non-native endianness
119135
*
120136
* Examples
121137
* - float: type_code = 2, bits = 32, lanes=1
@@ -172,7 +188,7 @@ typedef struct {
172188
/*! \brief The device of the tensor */
173189
DLDevice device;
174190
/*! \brief Number of dimensions */
175-
int ndim;
191+
int32_t ndim;
176192
/*! \brief The data type of the pointer*/
177193
DLDataType dtype;
178194
/*! \brief The shape of the tensor */

0 commit comments

Comments
 (0)