Changes supporting GEOSX Trilinos/Tpetra wrapper
This PR adds a simple function in ArrayView (and NewChaiBuffer) to get the data pointer in a specific MemorySpace, whether most current or not.
While this should not be needed/used by most developers, Tpetra implements dual memory space semantics, meaning that Tpetra::Vector for example contains pointers in both host and device memory spaces, and can potentially move data between them as needed. Therefore, in order to support the zero-copy creation of parallel vectors from ArrayView of local values, we have to be able to deliver pointers in both memory spaces.
Related to https://github.com/GEOSX/GEOSX/pull/1086
Note: code in GEOSX that uses this is currently disabled behind an #if 0, because I found out some Tpetra-based solvers only work reliably with Unified Memory, and so the zero-copy dual-view semantics cannot be implemented. So this PR could in principle be abandoned, however I though it might be useful in future.
Note: code in GEOSX that uses this is currently disabled behind an
#if 0, because I found out some Tpetra-based solvers only work reliably with Unified Memory, and so the zero-copy dual-view semantics cannot be implemented. So this PR could in principle be abandoned, however I though it might be useful in future.
Do we need to update Trilinos?
Do we need to update Trilinos?
No, there's no new version available. And it's not something they seem to have fixed yet. All Tpetra build instructions, FAQs, etc. explicitly require configuring Kokkos to use UM as default memory space for CUDA.
Do we need to update Trilinos?
No, there's no new version available. And it's not something they seem to have fixed yet. All Tpetra build instructions, FAQs, etc. explicitly require configuring Kokkos to use UM as default memory space for CUDA.
🤦
No, there's no new version available. And it's not something they seem to have fixed yet. All Tpetra build instructions, FAQs, etc. explicitly require configuring Kokkos to use UM as default memory space for CUDA.
🤦
We can always just allocate the matrix with unified memory, it would be pretty easy to add that support.