From ddcf0798692df23af6e379656c9ad0db859818bc Mon Sep 17 00:00:00 2001 From: Dewey Dunnington Date: Wed, 10 Apr 2024 05:19:14 -0300 Subject: [PATCH] GH-40801: [Docs] Clarify device identifier documentation in the Arrow C Device data interface (#41101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ### Rationale for this change It is not explicit what the value of the `ArrowDeviceArray::device_id` should be when a given device type has no notion of a device identifier (e.g., there is always only one). ### What changes are included in this PR? The text was clarified to recommend a value of -1. This was the value already used by Arrow C++. ### Are these changes tested? No tests needed (documentation) ### Are there any user-facing changes? No * GitHub Issue: #40801 Authored-by: Dewey Dunnington Signed-off-by: Raúl Cumplido --- docs/source/format/CDeviceDataInterface.rst | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docs/source/format/CDeviceDataInterface.rst b/docs/source/format/CDeviceDataInterface.rst index b5b7229a679e1..dd8b7e98e1cba 100644 --- a/docs/source/format/CDeviceDataInterface.rst +++ b/docs/source/format/CDeviceDataInterface.rst @@ -256,6 +256,10 @@ has the following fields: type are on the system. The semantics of the id will be hardware dependent, but we use an ``int64_t`` to future-proof the id as devices change over time. + For device types that do not have an intrinsic notion of a device identifier (e.g., + ``ARROW_DEVICE_CPU``), it is recommended to use a ``device_id`` of -1 as a + convention. + .. c:member:: ArrowDeviceType ArrowDeviceArray.device_type *Mandatory.* The type of the device which can access the buffers in the array. @@ -689,4 +693,4 @@ Any incompatible changes should be part of a new specification, for example .. _Vulkan: https://www.vulkan.org/ .. _Metal: https://developer.apple.com/metal/ .. _ROCm: https://www.amd.com/en/graphics/servers-solutions-rocm -.. _oneAPI: https://www.intel.com/content/www/us/en/developer/tools/oneapi/overview.html \ No newline at end of file +.. _oneAPI: https://www.intel.com/content/www/us/en/developer/tools/oneapi/overview.html