Skip to content

Commit aaa634b

Browse files
authored
Sycl gemv beta (#2276)
* BLAS - GEMV: zero out Y when beta == 0 in SYCL TPL code path * BLAS - GEMV: reverting wrong change from previous PR, my bad. * Applying clang-format
1 parent cb7a552 commit aaa634b

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

blas/src/KokkosBlas2_gemv.hpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ void gemv(const ExecutionSpace& space, const char trans[],
165165
// oneMKL supports both row-major and column-major of A
166166
// but only supports oneapi::mkl::transpose::nontrans op
167167
useFallback =
168-
useFallback || ((tolower(*trans) == 't' || tolower(*trans) == 'c') &&
169-
std::is_same_v<typename AViewType::memory_space,
170-
Kokkos::Experimental::SYCLDeviceUSMSpace>);
168+
useFallback || !std::is_same_v<typename AViewType::memory_space,
169+
Kokkos::Experimental::SYCLDeviceUSMSpace>;
171170
#endif
172171
#endif
173172

blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -824,6 +824,10 @@ struct kokkos_to_std_type_map<T, true> {
824824
const AViewType& A, const XViewType& X, \
825825
typename YViewType::const_value_type& beta, \
826826
const YViewType& Y) { \
827+
if (beta == Kokkos::ArithTraits<SCALAR>::zero()) { \
828+
Kokkos::deep_copy(Y, Kokkos::ArithTraits<SCALAR>::zero()); \
829+
} \
830+
\
827831
bool row_major = std::is_same<Kokkos::LayoutRight, LAYOUT>::value; \
828832
const std::int64_t M = A.extent(0); \
829833
const std::int64_t N = A.extent(1); \

0 commit comments

Comments
 (0)