ArborX icon indicating copy to clipboard operation
ArborX copied to clipboard

Provide specialization of AccessTraits for std::vector

Open aprokop opened this issue 6 months ago • 7 comments

This PR provides a specialization of AccessTraits for std::vector for user convenience.

In general, we should document somewhere that we reserve the right to provide those specializations for something user's don't control in their libraries (like, things from std::). If users want to provide custom specializations for those, they should wrap inside a holder.

aprokop avatar Jun 09 '25 21:06 aprokop

Not sure it is a good idea

dalg24 avatar Jun 09 '25 21:06 dalg24

Not sure it is a good idea

When updating the wrappers for deal.II, we realized that there is a lot of boiler code to write with the new interface. It makes it unnecessary hard to use ArborX. With ArborX 1.X, we only needed to write access_traits. Now to do the same thing, we need to write an ExtractIndex structure, the acces_traits, and the IndexableGetter. For most people, only the IndexableGetter uses user data.

Rombur avatar Jun 10 '25 00:06 Rombur

Not sure it is a good idea

What do you see as the difference between Kokkos::View and std::vector specializations?

aprokop avatar Jun 10 '25 00:06 aprokop

Views are fit for accelerators. What would we want to do about host device annotations on the access functions?

dalg24 avatar Jun 10 '25 01:06 dalg24

What would we want to do about host device annotations on the access functions?

Not use them. Everything will be HostSpace, so we won't need annotations.

aprokop avatar Jun 10 '25 01:06 aprokop

It is not about what memory space we tag it with, we'd run into issues when CUDA or HIP are enabled. Also, I am not sure how it interacts with NVHPC when stdpar is enabled.

dalg24 avatar Jun 10 '25 02:06 dalg24

It is not about what memory space we tag it with, we'd run into issues when CUDA or HIP are enabled.

Why? It worked correctly with the previous API. I have been doing that for years in adamantine.

Rombur avatar Jun 10 '25 03:06 Rombur