From 2f60ca376eda8cef19b93064fe209aeebe995f7c Mon Sep 17 00:00:00 2001 From: yangfengzzz Date: Tue, 10 Nov 2026 11:18:16 +0800 Subject: [PATCH] Add DLPack device types for Moore Threads MUSA --- docs/source/python_spec.rst | 2 +- include/dlpack/dlpack.h | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/source/python_spec.rst b/docs/source/python_spec.rst index 6390e08..058f573 100644 --- a/docs/source/python_spec.rst +++ b/docs/source/python_spec.rst @@ -42,7 +42,7 @@ the requesting (consumer) library does not support, it is recommended to raise a :obj:`BufferError`, unless an explicit copy is requested (see below) and the producer can support the request. -Stream handling through the ``stream`` keyword applies to CUDA and ROCm (perhaps +Stream handling through the ``stream`` keyword applies to CUDA, ROCm, and MUSA (perhaps to other devices that have a stream concept as well, however those haven't been considered in detail). The consumer must pass the stream it will use to the producer; the producer must synchronize or wait on the stream when necessary. diff --git a/include/dlpack/dlpack.h b/include/dlpack/dlpack.h index a890c0f..e9049ba 100644 --- a/include/dlpack/dlpack.h +++ b/include/dlpack/dlpack.h @@ -126,6 +126,12 @@ typedef enum { kDLTPUHost = 20, /*! \brief Huawei Ascend NPU device */ kDLAscend = 21, + /*! \brief Moore Threads MUSA GPU device memory */ + kDLMUSA = 22, + /*! \brief Pinned MUSA host memory allocated by musaMallocHost or musaHostAlloc */ + kDLMUSAHost = 23, + /*! \brief MUSA managed/unified memory allocated by musaMallocManaged */ + kDLMUSAManaged = 24, } DLDeviceType; /*!