You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
GH-40698: [C++] Create registry for Devices to map DeviceType to MemoryManager in C Device Data import (#40699)
### Rationale for this change
Follow-up on #39980 (comment)
Right now, the user of `ImportDeviceArray` or `ImportDeviceRecordBatch` needs to provide a `DeviceMemoryMapper` mapping the device type and id to a MemoryManager. We provide a default implementation of that mapper that just knows about the default CPU memory manager (and there is another implementation in `arrow::cuda`, but you need to explicitly pass that to the import function)
To make this easier, this PR adds a registry such that default device mappers can be added separately.
### What changes are included in this PR?
This PR adds two new public functions to register device types (`RegisterDeviceMemoryManager`) and retrieve the mapper from the registry (`GetDeviceMemoryManager`).
Further, it provides a `RegisterCUDADevice` to optionally register the CUDA devices (by default only CPU device is registered).
### Are these changes tested?
### Are there any user-facing changes?
* GitHub Issue: #40698
Lead-authored-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
Signed-off-by: Joris Van den Bossche <jorisvandenbossche@gmail.com>
0 commit comments