Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Why CrsMatrix::staticcrsgraph_type uses execution_space and not device_type? #665

Closed
brian-kelley opened this issue Mar 24, 2020 · 3 comments

Comments

@brian-kelley
Copy link
Contributor

@ndellingwood In KokkosSparse_CrsMatrix.hpp, the graph type is defined using execution_space, not device_type. Is this intentional? I think it will need to be changed for Tpetra to remove UVM from CrsMatrix/CrsGraph, because when UVM is enabled as the default memory space for Kokkos::Cuda, it's not possible to instantiate KokkosSparse::CrsMatrix for device = Device<Cuda, CudaSpace>.

409 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
410   //! Type of the graph structure of the sparse matrix.
411   typedef Kokkos::StaticCrsGraph<ordinal_type, Kokkos::LayoutLeft, execution_space, size_type, memory_traits> StaticCrsGraphType;
412   //! Type of the graph structure of the sparse matrix - consistent with Kokkos.
413   typedef Kokkos::StaticCrsGraph<ordinal_type, Kokkos::LayoutLeft, execution_space, size_type, memory_traits> staticcrsgraph_type;
414 #else
415   //! Type of the graph structure of the sparse matrix.
416   typedef Kokkos::StaticCrsGraph<ordinal_type, Kokkos::LayoutLeft, execution_space, memory_traits, size_type> StaticCrsGraphType;
417   //! Type of the graph structure of the sparse matrix - consistent with Kokkos.
418   typedef Kokkos::StaticCrsGraph<ordinal_type, Kokkos::LayoutLeft, execution_space, memory_traits, size_type> staticcrsgraph_type;
419 #endif
@ndellingwood
Copy link
Contributor

ndellingwood commented Mar 24, 2020

Is this intentional?

@brian-kelley I don't think so, I'm not sure who wrote the original code but I just checked the Kokkos StaticCrsGraph and the third template parameter is intended to be a DeviceType, not specifically an execution space.

@brian-kelley
Copy link
Contributor Author

@ndellingwood OK, I'll change this to a bug and make a PR.

@brian-kelley brian-kelley added bug and removed question labels Mar 24, 2020
brian-kelley added a commit to brian-kelley/kokkos-kernels that referenced this issue Mar 24, 2020
for StaticCrsGraph typedef inside CrsMatrix. This is important
for when the device type uses a different memory space than the
default for the exec space (which Tpetra will want to do with CudaSpace
soon).
@brian-kelley
Copy link
Contributor Author

brian-kelley commented Mar 25, 2020

Fix in #666 (ooh, the PR of the beast)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants