From d84217552b2344f956232ce9da4ecedad8a11fea Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Mon, 18 Mar 2024 09:20:06 -0600 Subject: [PATCH 1/3] KokkosKernels Utils: cleaning the zero_vector interface One of the overload requires an unused template, removing that extraneous template and simplify how that function is called in a second overload. --- common/src/KokkosKernels_Utils.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/common/src/KokkosKernels_Utils.hpp b/common/src/KokkosKernels_Utils.hpp index e1c15505ff..ba8049cecf 100644 --- a/common/src/KokkosKernels_Utils.hpp +++ b/common/src/KokkosKernels_Utils.hpp @@ -890,7 +890,7 @@ void permute_block_vector(typename idx_array_type::value_type num_elements, // TODO BMK: clean this up by removing 1st argument. It is unused but // its name gives the impression that only num_elements of the vector are // zeroed, when really it's always the whole thing. -template +template void zero_vector(ExecSpaceIn &exec_space_in, typename value_array_type::value_type /* num_elements */, value_array_type &vector) { @@ -906,8 +906,7 @@ void zero_vector(typename value_array_type::value_type /* num_elements */, using ne_tmp_t = typename value_array_type::value_type; ne_tmp_t ne_tmp = ne_tmp_t(0); MyExecSpace my_exec_space; - zero_vector(my_exec_space, ne_tmp, - vector); + zero_vector(my_exec_space, ne_tmp, vector); } template From e88b1a12ab0550eb74ae3e0dd09f07c9fe1b5efb Mon Sep 17 00:00:00 2001 From: "Luc Berger-Vergiat (-EXP)" Date: Mon, 18 Mar 2024 17:21:19 -0600 Subject: [PATCH 2/3] Kokkos Kernels: fixing call to zero_vector in Gauss-Seidel --- sparse/impl/KokkosSparse_gauss_seidel_impl.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp index 7391e00e3d..02626bab44 100644 --- a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp +++ b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp @@ -1548,7 +1548,7 @@ class PointGaussSeidel { } if (init_zero_x_vector) { KokkosKernels::Impl::zero_vector< - MyExecSpace, scalar_persistent_work_view2d_t, MyExecSpace>( + MyExecSpace, scalar_persistent_work_view2d_t>( my_exec_space, num_cols * block_size, Permuted_Xvector); } else { KokkosKernels::Impl::permute_block_vector< @@ -1665,7 +1665,7 @@ class PointGaussSeidel { } if (init_zero_x_vector) { KokkosKernels::Impl::zero_vector< - MyExecSpace, scalar_persistent_work_view2d_t, MyExecSpace>( + MyExecSpace, scalar_persistent_work_view2d_t>( my_exec_space, num_cols, Permuted_Xvector); } else { KokkosKernels::Impl::permute_vector< From 44b4418db543ac47f3119cae59e1e3a935ce8556 Mon Sep 17 00:00:00 2001 From: Luc Berger-Vergiat Date: Tue, 26 Mar 2024 09:40:15 -0600 Subject: [PATCH 3/3] Applying clang-format --- sparse/impl/KokkosSparse_gauss_seidel_impl.hpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp index 02626bab44..f0b78408bc 100644 --- a/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp +++ b/sparse/impl/KokkosSparse_gauss_seidel_impl.hpp @@ -1547,8 +1547,8 @@ class PointGaussSeidel { Permuted_Yvector); } if (init_zero_x_vector) { - KokkosKernels::Impl::zero_vector< - MyExecSpace, scalar_persistent_work_view2d_t>( + KokkosKernels::Impl::zero_vector( my_exec_space, num_cols * block_size, Permuted_Xvector); } else { KokkosKernels::Impl::permute_block_vector< @@ -1664,8 +1664,8 @@ class PointGaussSeidel { Permuted_Yvector); } if (init_zero_x_vector) { - KokkosKernels::Impl::zero_vector< - MyExecSpace, scalar_persistent_work_view2d_t>( + KokkosKernels::Impl::zero_vector( my_exec_space, num_cols, Permuted_Xvector); } else { KokkosKernels::Impl::permute_vector<