Skip to content

Commit

Permalink
Fix build error on some platforms
Browse files Browse the repository at this point in the history
  • Loading branch information
jgfouca committed Apr 18, 2024
1 parent 9065969 commit 06817d1
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions packages/ifpack2/src/Ifpack2_Experimental_RBILUK_def.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1156,6 +1156,8 @@ apply (const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_t
else {
// Kokkos kernels impl. For now, the only block trsv available is Sequential
// and must be done on host.
using size_type = typename local_matrix_host_type::size_type;

auto X_view = X.getLocalViewHost(Tpetra::Access::ReadOnly);
auto Y_view = Y.getLocalViewHost(Tpetra::Access::ReadWrite);

Expand All @@ -1168,17 +1170,21 @@ apply (const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_t

Kokkos::View<impl_scalar_type*, Kokkos::Serial> L_values_host_non_const("", L_values_host.size());
Kokkos::View<local_ordinal_type*, Kokkos::Serial> L_entries_host_non_const("", L_entries_host.size());
Kokkos::View<size_type*, Kokkos::Serial> L_row_ptrs_host_non_const("", L_row_ptrs_host.size());
Kokkos::deep_copy(L_values_host_non_const, L_values_host);
Kokkos::deep_copy(L_entries_host_non_const, L_entries_host);
Kokkos::deep_copy(L_row_ptrs_host_non_const, L_row_ptrs_host);

Kokkos::View<impl_scalar_type*, Kokkos::Serial> U_values_host_non_const("", U_values_host.size());
Kokkos::View<local_ordinal_type*, Kokkos::Serial> U_entries_host_non_const("", U_entries_host.size());
Kokkos::View<size_type*, Kokkos::Serial> U_row_ptrs_host_non_const("", U_row_ptrs_host.size());
Kokkos::deep_copy(U_values_host_non_const, U_values_host);
Kokkos::deep_copy(U_entries_host_non_const, U_entries_host);
Kokkos::deep_copy(U_row_ptrs_host_non_const, U_row_ptrs_host);

const auto numRows = L_block_->getLocalNumRows();
local_matrix_host_type L_block_local_host("L_block_local_host", numRows, numRows, L_entries_host.size(), L_values_host_non_const, L_row_ptrs_host, L_entries_host_non_const, blockSize_);
local_matrix_host_type U_block_local_host("U_block_local_host", numRows, numRows, U_entries_host.size(), U_values_host_non_const, U_row_ptrs_host, U_entries_host_non_const, blockSize_);
local_matrix_host_type L_block_local_host("L_block_local_host", numRows, numRows, L_entries_host.size(), L_values_host_non_const, L_row_ptrs_host_non_const, L_entries_host_non_const, blockSize_);
local_matrix_host_type U_block_local_host("U_block_local_host", numRows, numRows, U_entries_host.size(), U_values_host_non_const, U_row_ptrs_host_non_const, U_entries_host_non_const, blockSize_);

if (mode == Teuchos::NO_TRANS) {
KokkosSparse::trsv("L", "N", "N", L_block_local_host, X_view, Y_view);
Expand Down

0 comments on commit 06817d1

Please sign in to comment.