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

fix: alias for serial trsv #2458

Merged
merged 1 commit into from
Dec 13, 2024
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
58 changes: 35 additions & 23 deletions batched/dense/src/KokkosBatched_Trsv_Decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,11 +76,11 @@ struct Trsv {
KOKKOS_INLINE_FUNCTION static int invoke(const MemberType &member, const ScalarType alpha, const AViewType &A,
const bViewType &b) {
int r_val = 0;
if (std::is_same<ArgMode, Mode::Serial>::value) {
if (std::is_same_v<ArgMode, Mode::Serial>) {
r_val = SerialTrsv<ArgUplo, ArgTrans, ArgDiag, ArgAlgo>::invoke(alpha, A, b);
} else if (std::is_same<ArgMode, Mode::Team>::value) {
} else if (std::is_same_v<ArgMode, Mode::Team>) {
r_val = TeamTrsv<MemberType, ArgUplo, ArgTrans, ArgDiag, ArgAlgo>::invoke(member, alpha, A, b);
} else if (std::is_same<ArgMode, Mode::TeamVector>::value) {
} else if (std::is_same_v<ArgMode, Mode::TeamVector>) {
r_val = TeamVectorTrsv<MemberType, ArgUplo, ArgTrans, ArgDiag, ArgAlgo>::invoke(member, alpha, A, b);
}
return r_val;
Expand All @@ -93,17 +93,29 @@ struct Trsv {
#include "KokkosBatched_Trsv_Team_Impl.hpp"
#include "KokkosBatched_Trsv_TeamVector_Impl.hpp"

#define KOKKOSBATCHED_SERIAL_TRSV_LOWER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::SerialTrsvInternalLower<ALGOTYPE>::invoke(DIAG::use_unit_diag, M, ALPHA, A, AS0, AS1, B, BS)
#define KOKKOSBATCHED_SERIAL_TRSV_LOWER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::Impl::SerialTrsvInternalLower<ALGOTYPE>::invoke(DIAG::use_unit_diag, false, M, ALPHA, A, AS0, AS1, B, \
BS)

#define KOKKOSBATCHED_SERIAL_TRSV_LOWER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::SerialTrsvInternalUpper<ALGOTYPE>::invoke(DIAG::use_unit_diag, N, ALPHA, A, AS1, AS0, B, BS)
#define KOKKOSBATCHED_SERIAL_TRSV_LOWER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::Impl::SerialTrsvInternalUpper<ALGOTYPE>::invoke(DIAG::use_unit_diag, false, N, ALPHA, A, AS1, AS0, B, \
BS)

#define KOKKOSBATCHED_SERIAL_TRSV_UPPER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::SerialTrsvInternalUpper<ALGOTYPE>::invoke(DIAG::use_unit_diag, M, ALPHA, A, AS0, AS1, B, BS)
#define KOKKOSBATCHED_SERIAL_TRSV_LOWER_CONJTRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::Impl::SerialTrsvInternalUpper<ALGOTYPE>::invoke(DIAG::use_unit_diag, true, N, ALPHA, A, AS1, AS0, B, \
BS)

#define KOKKOSBATCHED_SERIAL_TRSV_UPPER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::SerialTrsvInternalLower<ALGOTYPE>::invoke(DIAG::use_unit_diag, N, ALPHA, A, AS1, AS0, B, BS)
#define KOKKOSBATCHED_SERIAL_TRSV_UPPER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::Impl::SerialTrsvInternalUpper<ALGOTYPE>::invoke(DIAG::use_unit_diag, false, M, ALPHA, A, AS0, AS1, B, \
BS)

#define KOKKOSBATCHED_SERIAL_TRSV_UPPER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::Impl::SerialTrsvInternalLower<ALGOTYPE>::invoke(DIAG::use_unit_diag, false, N, ALPHA, A, AS1, AS0, B, \
BS)

#define KOKKOSBATCHED_SERIAL_TRSV_UPPER_CONJTRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS) \
KokkosBatched::Impl::SerialTrsvInternalLower<ALGOTYPE>::invoke(DIAG::use_unit_diag, true, N, ALPHA, A, AS1, AS0, B, \
BS)

#define KOKKOSBATCHED_TEAM_TRSV_LOWER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, \
B, BS) \
Expand Down Expand Up @@ -143,46 +155,46 @@ struct Trsv {

#define KOKKOSBATCHED_TRSV_LOWER_NO_TRANSPOSE_INTERNAL_INVOKE(MODETYPE, ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, \
AS1, B, BS) \
if (std::is_same<MODETYPE, KokkosBatched::Mode::Serial>::value) { \
if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Serial>) { \
KOKKOSBATCHED_SERIAL_TRSV_LOWER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::Team>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Team>) { \
KOKKOSBATCHED_TEAM_TRSV_LOWER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, B, \
BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::TeamVector>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::TeamVector>) { \
KOKKOSBATCHED_TEAMVECTOR_TRSV_LOWER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, \
B, BS); \
}

#define KOKKOSBATCHED_TRSV_LOWER_TRANSPOSE_INTERNAL_INVOKE(MODETYPE, ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, \
B, BS) \
if (std::is_same<MODETYPE, KokkosBatched::Mode::Serial>::value) { \
if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Serial>) { \
KOKKOSBATCHED_SERIAL_TRSV_LOWER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::Team>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Team>) { \
KOKKOSBATCHED_TEAM_TRSV_LOWER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::TeamVector>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::TeamVector>) { \
KOKKOSBATCHED_TEAMVECTOR_TRSV_LOWER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, B, \
BS); \
}

#define KOKKOSBATCHED_TRSV_UPPER_NO_TRANSPOSE_INTERNAL_INVOKE(MODETYPE, ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, \
AS1, B, BS) \
if (std::is_same<MODETYPE, KokkosBatched::Mode::Serial>::value) { \
if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Serial>) { \
KOKKOSBATCHED_SERIAL_TRSV_UPPER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::Team>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Team>) { \
KOKKOSBATCHED_TEAM_TRSV_UPPER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, B, \
BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::TeamVector>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::TeamVector>) { \
KOKKOSBATCHED_TEAMVECTOR_TRSV_UPPER_NO_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, \
B, BS); \
}

#define KOKKOSBATCHED_TRSV_UPPER_TRANSPOSE_INTERNAL_INVOKE(MODETYPE, ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, \
B, BS) \
if (std::is_same<MODETYPE, KokkosBatched::Mode::Serial>::value) { \
if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Serial>) { \
KOKKOSBATCHED_SERIAL_TRSV_UPPER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::Team>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::Team>) { \
KOKKOSBATCHED_TEAM_TRSV_UPPER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, B, BS); \
} else if (std::is_same<MODETYPE, KokkosBatched::Mode::TeamVector>::value) { \
} else if (std::is_same_v<MODETYPE, KokkosBatched::Mode::TeamVector>) { \
KOKKOSBATCHED_TEAMVECTOR_TRSV_UPPER_TRANSPOSE_INTERNAL_INVOKE(ALGOTYPE, MEMBER, DIAG, M, N, ALPHA, A, AS0, AS1, B, \
BS); \
}
Expand Down
Loading