`dlpack` conversion for c++ `mdspan`
- Dominant language
- C++
- Stars
- 1.2k
- Forks
- 169
- PR merge metrics
- No merged PRs in 30d
Description
I am currently looking into providing `dlpack` conversions to `mdspan`, specifically the device-portable version in https://github.com/kokkos/mdspan. This could help e.g. `scipy` to consolidate implementations, see https://github.com/scipy/scipy/issues/21798
But for our Kokkos users, the more pressing usecase is calling python-based ML models from large c++ codes running in high performance computing environments.
Would you agree, that for the usecase of converting a `mdspan` via `dlpack` for passing data from c++ to python, the mutability should be in agreement with the const-ness of the producer? Meaning if c++ manages the memory and the `mdspan` is non-const, it should be a mutable `dlpack`? This is with the assumption that the c++ and python are in sequential order.
For potentially using `mdspan` in implementations in e.g. `interpolate` in scipy, the semantics that `dlpack` spells out in https://dmlc.github.io/dlpack/latest/python_spec.html#semantics are definitely the way to go.
Originated from a discussion with @rgommers in https://github.com/scipy/scipy/issues/21798#issuecomment-4037559576
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.