From c654675d8a90fe907f0769db057d33dc7cf8d553 Mon Sep 17 00:00:00 2001 From: Tim Head Date: Fri, 7 Aug 2026 16:39:08 +0200 Subject: [PATCH 1/2] Update the list of DLPack devices Taken directly from the dlpack.h header --- src/array_api_stubs/_draft/array_object.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/array_api_stubs/_draft/array_object.py b/src/array_api_stubs/_draft/array_object.py index 9a2d36696..8940bc212 100644 --- a/src/array_api_stubs/_draft/array_object.py +++ b/src/array_api_stubs/_draft/array_object.py @@ -514,8 +514,15 @@ def __dlpack_device__(self: array, /) -> Tuple[Enum, int]: METAL = 8 VPI = 9 ROCM = 10 + ROCM_PINNED = 11 CUDA_MANAGED = 13 ONE_API = 14 + WEB_GPU = 15 + HEXAGON = 16 + MAIA = 17 + TRAINIUM = 18 + TPU = 19 + TPU_PINNED = 20 """ def __eq__(self: array, other: Union[int, float, complex, bool, array], /) -> array: From b9cf10fbdc9e3ce48b56f10de0bac56bae05d461 Mon Sep 17 00:00:00 2001 From: Tim Head Date: Mon, 10 Aug 2026 09:26:27 +0200 Subject: [PATCH 2/2] Add comment about the extension device --- src/array_api_stubs/_draft/array_object.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/array_api_stubs/_draft/array_object.py b/src/array_api_stubs/_draft/array_object.py index 8940bc212..c4148025d 100644 --- a/src/array_api_stubs/_draft/array_object.py +++ b/src/array_api_stubs/_draft/array_object.py @@ -524,6 +524,7 @@ def __dlpack_device__(self: array, /) -> Tuple[Enum, int]: TPU = 19 TPU_PINNED = 20 """ + # The ExtDev (enum value 12) device has not been included as its semantics are not fixed. def __eq__(self: array, other: Union[int, float, complex, bool, array], /) -> array: r"""