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

gemv: call scal for degenerate matrices #569

Merged
merged 1 commit into from
Jan 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 4 additions & 8 deletions src/blas/KokkosBlas2_gemv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
#include <sstream>
#include <type_traits> // requires C++11, but so does Kokkos

#include <KokkosBlas1_scal.hpp>

namespace KokkosBlas {

/// \brief Dense matrix-vector multiply: y = beta*y + alpha*A*x.
Expand Down Expand Up @@ -139,15 +141,9 @@ gemv (const char trans[],
typename YViewType::device_type,
Kokkos::MemoryTraits<Kokkos::Unmanaged> > YVT;

if ((trans[0] == 'T' || trans[0] == 't') && A.extent(0) == 0
#ifdef KOKKOS_ENABLE_CUDA
&& !std::is_same<typename AViewType::device_type::execution_space, Kokkos::Cuda>::value
#endif
)
if (A.extent(0) == 0 || A.extent(1) == 0)
{
const bool eti_spec_avail = KokkosBlas::Impl::gemv_eti_spec_avail<AVT, XVT, YVT>::value;
typedef Impl::GEMV<AVT, XVT, YVT, false, eti_spec_avail> fallback_impl_type;
fallback_impl_type::gemv (trans, alpha, A, x, beta, y);
KokkosBlas::scal(y, beta, y);
}
else
{
Expand Down