Skip to content

Commit

Permalink
apacheGH-40801: [Docs] Clarify device identifier documentation in the…
Browse files Browse the repository at this point in the history
… Arrow C Device data interface (apache#41101)

### 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: apache#40801

Authored-by: Dewey Dunnington <dewey@voltrondata.com>
Signed-off-by: Raúl Cumplido <raulcumplido@gmail.com>
  • Loading branch information
paleolimbot authored and tolleybot committed May 2, 2024
1 parent ed5a0b4 commit ddcf079
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion docs/source/format/CDeviceDataInterface.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
.. _oneAPI: https://www.intel.com/content/www/us/en/developer/tools/oneapi/overview.html

0 comments on commit ddcf079

Please sign in to comment.