NVIDIA / NVIDIA/cccl

[cuda.compute]: Add support for accepting DLPack arrays

Open
#6,883 5 comments 1 reaction 0 assignees View on GitHub
Dominant language
C++
Stars
2.5k
Forks
486
Avg merge
2d 6h
Merged PRs (30d)
295

Description

In cuda.compute, we currently require that input arrays implement [`__cuda_array_interface__`](https://numba.readthedocs.io/en/stable/cuda/cuda_array_interface.html). This allows us to support Python arrays from different libraries in `cuda.compute` since it is a standard interface to extract array metadata.

[DLPack](https://dmlc.github.io/dlpack/latest/) is a more recent standard supported by a larger number of array libraries. We should allow users to pass in DLPack arrays instead of only `__cuda_array_interface__`.

`cuda.core` includes [`StridedMemoryView`](https://nvidia.github.io/cuda-python/cuda-core/latest/generated/cuda.core.experimental.utils.StridedMemoryView.html) which extracts array metadata from arrays that implement both `__cuda_array_interface__` and DLPack. We should use `StridedMemoryView` in `cuda.compute`.

cc @shwina

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.