Skip to content

Commit

Permalink
Remove test for extent = 1 as subview of LayoutRight yields LayoutStride
Browse files Browse the repository at this point in the history
  • Loading branch information
uhetmaniuk committed Jan 11, 2022
1 parent f6051aa commit 319cb36
Showing 1 changed file with 6 additions and 20 deletions.
26 changes: 6 additions & 20 deletions src/sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -288,27 +288,13 @@ struct SPMV_MV_BSRMATRIX<AT, AO, AD, AM, AS, XT, XL, XD, XM, YT, YL, YD, YM,
if ((mode[0] == KokkosSparse::NoTranspose[0]) ||
(mode[0] == KokkosSparse::Conjugate[0])) {
bool useConjugate = (mode[0] == KokkosSparse::Conjugate[0]);
if (X.extent(1) == 1) {
const auto x0 = Kokkos::subview(X, Kokkos::ALL(), 0);
auto y0 = Kokkos::subview(Y, Kokkos::ALL(), 0);
return Bsr::spMatVec_no_transpose(controls, alpha, A, x0, beta, y0,
useConjugate);
} else {
return Bsr::spMatMultiVec_no_transpose(controls, alpha, A, X, beta, Y,
useConjugate);
}
return Bsr::spMatMultiVec_no_transpose(controls, alpha, A, X, beta, Y,
useConjugate);
} else if ((mode[0] == KokkosSparse::Transpose[0]) ||
(mode[0] == KokkosSparse::ConjugateTranspose[0])) {
bool useConjugate = (mode[0] == KokkosSparse::ConjugateTranspose[0]);
if (X.extent(1) == 1) {
const auto x0 = Kokkos::subview(X, Kokkos::ALL(), 0);
auto y0 = Kokkos::subview(Y, Kokkos::ALL(), 0);
return Bsr::spMatVec_transpose(controls, alpha, A, x0, beta, y0,
useConjugate);
} else {
return Bsr::spMatMultiVec_transpose(controls, alpha, A, X, beta, Y,
useConjugate);
}
return Bsr::spMatMultiVec_transpose(controls, alpha, A, X, beta, Y,
useConjugate);
}
}
};
Expand All @@ -333,8 +319,8 @@ struct SPMV_MV_BSRMATRIX<AT, AO, AD, AM, AS, XT, XL, XD, XM, YT, YL, YD, YM,
YM>
impl_type;
for (typename AMatrix::non_const_size_type j = 0; j < X.extent(1); ++j) {
auto x_j = Kokkos::subview(X, Kokkos::ALL(), j);
auto y_j = Kokkos::subview(Y, Kokkos::ALL(), j);
const auto x_j = Kokkos::subview(X, Kokkos::ALL(), j);
auto y_j = Kokkos::subview(Y, Kokkos::ALL(), j);
impl_type::spmv_bsrmatrix(controls, mode, alpha, A, x_j, beta, y_j);
}
}
Expand Down

0 comments on commit 319cb36

Please sign in to comment.