diff --git a/batched/dense/impl/KokkosBatched_Gemv_Team_Impl.hpp b/batched/dense/impl/KokkosBatched_Gemv_Team_Impl.hpp index 1407bf43b4..8ae3ee0f44 100644 --- a/batched/dense/impl/KokkosBatched_Gemv_Team_Impl.hpp +++ b/batched/dense/impl/KokkosBatched_Gemv_Team_Impl.hpp @@ -46,9 +46,13 @@ struct TeamGemv { KOKKOS_INLINE_FUNCTION static int invoke( const MemberType &member, const ScalarType alpha, const AViewType &A, const xViewType &x, const ScalarType beta, const yViewType &y) { - static_assert(AViewType::rank == 3, - "Batched TeamGemv requires rank-3 A matrix (use " - "KokkosBlas::TeamGemv for regular rank-2 matrix)"); + constexpr char *assert_msg = + "Batched TeamGemv requires rank-3 A matrix (use " + "KokkosBlas::TeamGemv for regular rank-2 matrix)"; + if constexpr (Kokkos::is_dyn_rank_view) + assertm(A.rank_dynamic() == 3, assert_msg) else static_assert( + AViewType::rank == 3, assert_msg); + if (A.extent(0) == 1) { KokkosBlas::TeamGemv< MemberType, Trans::NoTranspose, @@ -79,9 +83,12 @@ struct TeamGemv { const xViewType & /*x*/, const ScalarType /*beta*/, const yViewType & /*y*/) { - static_assert(AViewType::rank == 3, - "Batched TeamGemv requires rank-3 A matrix (use " - "KokkosBlas::TeamGemv for regular rank-2 matrix)"); + constexpr char *assert_msg = + "Batched TeamGemv requires rank-3 A matrix (use " + "KokkosBlas::TeamGemv for regular rank-2 matrix)"; + if constexpr (Kokkos::is_dyn_rank_view) + assertm(A.rank_dynamic() == 3, assert_msg) else static_assert( + AViewType::rank == 3, assert_msg); Kokkos::abort( "KokkosBlas::TeamGemv for rank-3 matrix is NOT " "implemented"); @@ -99,9 +106,12 @@ struct TeamGemv { KOKKOS_INLINE_FUNCTION static int invoke( const MemberType &member, const ScalarType alpha, const AViewType &A, const xViewType &x, const ScalarType beta, const yViewType &y) { - static_assert(AViewType::rank == 3, - "Batched TeamGemv requires rank-3 A matrix (use " - "KokkosBlas::TeamGemv for regular rank-2 matrix)"); + constexpr char *assert_msg = + "Batched TeamGemv requires rank-3 A matrix (use " + "KokkosBlas::TeamGemv for regular rank-2 matrix)"; + if constexpr (Kokkos::is_dyn_rank_view) + assertm(A.rank_dynamic() == 3, assert_msg) else static_assert( + AViewType::rank == 3, assert_msg); if (A.extent(0) == 1) { KokkosBlas:: TeamGemv::invoke( @@ -129,9 +139,12 @@ struct TeamGemv { const xViewType & /*x*/, const ScalarType /*beta*/, const yViewType & /*y*/) { - static_assert(AViewType::rank == 3, - "Batched TeamGemv requires rank-3 A matrix (use " - "KokkosBlas::TeamGemv for regular rank-2 matrix)"); + constexpr char *assert_msg = + "Batched TeamGemv requires rank-3 A matrix (use " + "KokkosBlas::TeamGemv for regular rank-2 matrix)"; + if constexpr (Kokkos::is_dyn_rank_view) + assertm(A.rank_dynamic() == 3, assert_msg) else static_assert( + AViewType::rank == 3, assert_msg); Kokkos::abort( "KokkosBlas::TeamGemv for rank-3 matrix is NOT " "implemented");