diff --git a/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp index f380525ae3..2a0e00947c 100644 --- a/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Pbtrs_Serial_Internal.hpp @@ -17,6 +17,7 @@ #ifndef KOKKOSBATCHED_PBTRS_SERIAL_INTERNAL_HPP_ #define KOKKOSBATCHED_PBTRS_SERIAL_INTERNAL_HPP_ +#include "KokkosBlas_util.hpp" #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Tbsv_Serial_Internal.hpp" @@ -50,8 +51,9 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrsInternalLower::inv SerialTbsvInternalLower::invoke(false, an, A, as0, as1, x, xs0, kd); // Solve L**T *X = B, overwriting B with X. - constexpr bool do_conj = Kokkos::ArithTraits::is_complex; - SerialTbsvInternalLowerTranspose::invoke(false, do_conj, an, A, as0, as1, x, xs0, kd); + using op = + std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; + SerialTbsvInternalLowerTranspose::invoke(op(), false, an, A, as0, as1, x, xs0, kd); return 0; } @@ -76,8 +78,9 @@ KOKKOS_INLINE_FUNCTION int SerialPbtrsInternalUpper::inv /**/ ValueType *KOKKOS_RESTRICT x, const int xs0, const int kd) { // Solve U**T *X = B, overwriting B with X. - constexpr bool do_conj = Kokkos::ArithTraits::is_complex; - SerialTbsvInternalUpperTranspose::invoke(false, do_conj, an, A, as0, as1, x, xs0, kd); + using op = + std::conditional_t::is_complex, KokkosBlas::Impl::OpConj, KokkosBlas::Impl::OpID>; + SerialTbsvInternalUpperTranspose::invoke(op(), false, an, A, as0, as1, x, xs0, kd); // Solve U*X = B, overwriting B with X. SerialTbsvInternalUpper::invoke(false, an, A, as0, as1, x, xs0, kd); diff --git a/batched/dense/impl/KokkosBatched_Tbsv_Serial_Impl.hpp b/batched/dense/impl/KokkosBatched_Tbsv_Serial_Impl.hpp index 853e453b89..a6eaca062f 100644 --- a/batched/dense/impl/KokkosBatched_Tbsv_Serial_Impl.hpp +++ b/batched/dense/impl/KokkosBatched_Tbsv_Serial_Impl.hpp @@ -19,16 +19,17 @@ /// \author Yuuichi Asahi (yuuichi.asahi@cea.fr) +#include "KokkosBlas_util.hpp" #include "KokkosBatched_Util.hpp" #include "KokkosBatched_Tbsv_Serial_Internal.hpp" namespace KokkosBatched { - +namespace Impl { template KOKKOS_INLINE_FUNCTION static int checkTbsvInput([[maybe_unused]] const AViewType &A, [[maybe_unused]] const XViewType &x, [[maybe_unused]] const int k) { - static_assert(Kokkos::is_view::value, "KokkosBatched::tbsv: AViewType is not a Kokkos::View."); - static_assert(Kokkos::is_view::value, "KokkosBatched::tbsv: XViewType is not a Kokkos::View."); + static_assert(Kokkos::is_view_v, "KokkosBatched::tbsv: AViewType is not a Kokkos::View."); + static_assert(Kokkos::is_view_v, "KokkosBatched::tbsv: XViewType is not a Kokkos::View."); static_assert(AViewType::rank == 2, "KokkosBatched::tbsv: AViewType must have rank 2."); static_assert(XViewType::rank == 1, "KokkosBatched::tbsv: XViewType must have rank 1."); @@ -63,15 +64,17 @@ KOKKOS_INLINE_FUNCTION static int checkTbsvInput([[maybe_unused]] const AViewTyp return 0; } +} // namespace Impl + //// Lower non-transpose //// template struct SerialTbsv { template KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &x, const int k) { - auto info = checkTbsvInput(A, x, k); + auto info = Impl::checkTbsvInput(A, x, k); if (info) return info; - return SerialTbsvInternalLower::invoke( + return Impl::SerialTbsvInternalLower::invoke( ArgDiag::use_unit_diag, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), x.stride_0(), k); } }; @@ -81,11 +84,12 @@ template struct SerialTbsv { template KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &x, const int k) { - auto info = checkTbsvInput(A, x, k); + auto info = Impl::checkTbsvInput(A, x, k); if (info) return info; - return SerialTbsvInternalLowerTranspose::invoke( - ArgDiag::use_unit_diag, false, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), x.stride_0(), k); + return Impl::SerialTbsvInternalLowerTranspose::invoke( + KokkosBlas::Impl::OpID(), ArgDiag::use_unit_diag, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), + x.stride_0(), k); } }; @@ -94,11 +98,12 @@ template struct SerialTbsv { template KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &x, const int k) { - auto info = checkTbsvInput(A, x, k); + auto info = Impl::checkTbsvInput(A, x, k); if (info) return info; - return SerialTbsvInternalLowerTranspose::invoke( - ArgDiag::use_unit_diag, true, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), x.stride_0(), k); + return Impl::SerialTbsvInternalLowerTranspose::invoke( + KokkosBlas::Impl::OpConj(), ArgDiag::use_unit_diag, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), + x.stride_0(), k); } }; @@ -107,10 +112,10 @@ template struct SerialTbsv { template KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &x, const int k) { - auto info = checkTbsvInput(A, x, k); + auto info = Impl::checkTbsvInput(A, x, k); if (info) return info; - return SerialTbsvInternalUpper::invoke( + return Impl::SerialTbsvInternalUpper::invoke( ArgDiag::use_unit_diag, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), x.stride_0(), k); } }; @@ -120,11 +125,12 @@ template struct SerialTbsv { template KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &x, const int k) { - auto info = checkTbsvInput(A, x, k); + auto info = Impl::checkTbsvInput(A, x, k); if (info) return info; - return SerialTbsvInternalUpperTranspose::invoke( - ArgDiag::use_unit_diag, false, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), x.stride_0(), k); + return Impl::SerialTbsvInternalUpperTranspose::invoke( + KokkosBlas::Impl::OpID(), ArgDiag::use_unit_diag, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), + x.stride_0(), k); } }; @@ -133,11 +139,12 @@ template struct SerialTbsv { template KOKKOS_INLINE_FUNCTION static int invoke(const AViewType &A, const XViewType &x, const int k) { - auto info = checkTbsvInput(A, x, k); + auto info = Impl::checkTbsvInput(A, x, k); if (info) return info; - return SerialTbsvInternalUpperTranspose::invoke( - ArgDiag::use_unit_diag, true, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), x.stride_0(), k); + return Impl::SerialTbsvInternalUpperTranspose::invoke( + KokkosBlas::Impl::OpConj(), ArgDiag::use_unit_diag, A.extent(1), A.data(), A.stride_0(), A.stride_1(), x.data(), + x.stride_0(), k); } }; diff --git a/batched/dense/impl/KokkosBatched_Tbsv_Serial_Internal.hpp b/batched/dense/impl/KokkosBatched_Tbsv_Serial_Internal.hpp index 64221008cc..59f3f8f269 100644 --- a/batched/dense/impl/KokkosBatched_Tbsv_Serial_Internal.hpp +++ b/batched/dense/impl/KokkosBatched_Tbsv_Serial_Internal.hpp @@ -22,13 +22,13 @@ #include "KokkosBatched_Util.hpp" namespace KokkosBatched { - +namespace Impl { /// /// Serial Internal Impl /// ==================== /// -/// Lower, Non-Transpose +/// Lower /// template @@ -70,41 +70,29 @@ KOKKOS_INLINE_FUNCTION int SerialTbsvInternalLower::invok template struct SerialTbsvInternalLowerTranspose { - template - KOKKOS_INLINE_FUNCTION static int invoke(const bool use_unit_diag, const bool do_conj, const int an, + template + KOKKOS_INLINE_FUNCTION static int invoke(Op op, const bool use_unit_diag, const int an, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT x, const int xs0, const int k); }; template <> -template +template KOKKOS_INLINE_FUNCTION int SerialTbsvInternalLowerTranspose::invoke( - const bool use_unit_diag, const bool do_conj, const int an, const ValueType *KOKKOS_RESTRICT A, const int as0, - const int as1, + Op op, const bool use_unit_diag, const int an, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT x, const int xs0, const int k) { #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll #endif for (int j = an - 1; j >= 0; --j) { auto temp = x[j * xs0]; - - if (do_conj) { -#if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) -#pragma unroll -#endif - for (int i = Kokkos::min(an - 1, j + k); i > j; --i) { - temp -= Kokkos::ArithTraits::conj(A[(i - j) * as0 + j * as1]) * x[i * xs0]; - } - if (!use_unit_diag) temp = temp / Kokkos::ArithTraits::conj(A[0 + j * as1]); - } else { #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll #endif - for (int i = Kokkos::min(an - 1, j + k); i > j; --i) { - temp -= A[(i - j) * as0 + j * as1] * x[i * xs0]; - } - if (!use_unit_diag) temp = temp / A[0 + j * as1]; + for (int i = Kokkos::min(an - 1, j + k); i > j; --i) { + temp -= op(A[(i - j) * as0 + j * as1]) * x[i * xs0]; } + if (!use_unit_diag) temp = temp / op(A[0 + j * as1]); x[j * xs0] = temp; } @@ -112,7 +100,7 @@ KOKKOS_INLINE_FUNCTION int SerialTbsvInternalLowerTranspose @@ -154,46 +142,36 @@ KOKKOS_INLINE_FUNCTION int SerialTbsvInternalUpper::invok template struct SerialTbsvInternalUpperTranspose { - template - KOKKOS_INLINE_FUNCTION static int invoke(const bool use_unit_diag, const bool do_conj, const int an, + template + KOKKOS_INLINE_FUNCTION static int invoke(Op op, const bool use_unit_diag, const int an, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT x, const int xs0, const int k); }; template <> -template +template KOKKOS_INLINE_FUNCTION int SerialTbsvInternalUpperTranspose::invoke( - const bool use_unit_diag, const bool do_conj, const int an, const ValueType *KOKKOS_RESTRICT A, const int as0, - const int as1, + Op op, const bool use_unit_diag, const int an, const ValueType *KOKKOS_RESTRICT A, const int as0, const int as1, /**/ ValueType *KOKKOS_RESTRICT x, const int xs0, const int k) { #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll #endif for (int j = 0; j < an; j++) { auto temp = x[j * xs0]; - if (do_conj) { -#if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) -#pragma unroll -#endif - for (int i = Kokkos::max(0, j - k); i < j; ++i) { - temp -= Kokkos::ArithTraits::conj(A[(i + k - j) * as0 + j * as1]) * x[i * xs0]; - } - if (!use_unit_diag) temp = temp / Kokkos::ArithTraits::conj(A[k * as0 + j * as1]); - } else { #if defined(KOKKOS_ENABLE_PRAGMA_UNROLL) #pragma unroll #endif - for (int i = Kokkos::max(0, j - k); i < j; ++i) { - temp -= A[(i + k - j) * as0 + j * as1] * x[i * xs0]; - } - if (!use_unit_diag) temp = temp / A[k * as0 + j * as1]; + for (int i = Kokkos::max(0, j - k); i < j; ++i) { + temp -= op(A[(i + k - j) * as0 + j * as1]) * x[i * xs0]; } + if (!use_unit_diag) temp = temp / op(A[k * as0 + j * as1]); x[j * xs0] = temp; } return 0; } +} // namespace Impl } // namespace KokkosBatched #endif // KOKKOSBATCHED_TBSV_SERIAL_INTERNAL_HPP_ diff --git a/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp b/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp index cd52235dd6..240bdb561d 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTbsv.hpp @@ -22,8 +22,6 @@ #include "KokkosBatched_Tbsv.hpp" #include "Test_Batched_DenseUtils.hpp" -using namespace KokkosBatched; - namespace Test { namespace Tbsv { @@ -38,22 +36,22 @@ template struct Functor_BatchedSerialTrsv { using execution_space = typename DeviceType::execution_space; - AViewType _a; - BViewType _b; + AViewType m_a; + BViewType m_b; - ScalarType _alpha; + ScalarType m_alpha; KOKKOS_INLINE_FUNCTION Functor_BatchedSerialTrsv(const ScalarType alpha, const AViewType &a, const BViewType &b) - : _a(a), _b(b), _alpha(alpha) {} + : m_a(a), m_b(b), m_alpha(alpha) {} KOKKOS_INLINE_FUNCTION void operator()(const ParamTagType &, const int k) const { - auto aa = Kokkos::subview(_a, k, Kokkos::ALL(), Kokkos::ALL()); - auto bb = Kokkos::subview(_b, k, Kokkos::ALL()); + auto aa = Kokkos::subview(m_a, k, Kokkos::ALL(), Kokkos::ALL()); + auto bb = Kokkos::subview(m_b, k, Kokkos::ALL()); KokkosBatched::SerialTrsv::invoke(_alpha, aa, bb); + AlgoTagType>::invoke(m_alpha, aa, bb); } inline void run() { @@ -61,7 +59,7 @@ struct Functor_BatchedSerialTrsv { std::string name_region("KokkosBatched::Test::SerialTbsv"); const std::string name_value_type = Test::value_type_name(); std::string name = name_region + name_value_type; - Kokkos::RangePolicy policy(0, _b.extent(0)); + Kokkos::RangePolicy policy(0, m_b.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); } }; @@ -69,20 +67,20 @@ struct Functor_BatchedSerialTrsv { template struct Functor_BatchedSerialTbsv { using execution_space = typename DeviceType::execution_space; - AViewType _a; - BViewType _b; - int _k; + AViewType m_a; + BViewType m_b; + int m_k; KOKKOS_INLINE_FUNCTION - Functor_BatchedSerialTbsv(const AViewType &a, const BViewType &b, const int k) : _a(a), _b(b), _k(k) {} + Functor_BatchedSerialTbsv(const AViewType &a, const BViewType &b, const int k) : m_a(a), m_b(b), m_k(k) {} KOKKOS_INLINE_FUNCTION void operator()(const ParamTagType &, const int k) const { - auto aa = Kokkos::subview(_a, k, Kokkos::ALL(), Kokkos::ALL()); - auto bb = Kokkos::subview(_b, k, Kokkos::ALL()); + auto aa = Kokkos::subview(m_a, k, Kokkos::ALL(), Kokkos::ALL()); + auto bb = Kokkos::subview(m_b, k, Kokkos::ALL()); KokkosBatched::SerialTbsv::invoke(aa, bb, _k); + AlgoTagType>::invoke(aa, bb, m_k); } inline void run() { @@ -91,7 +89,7 @@ struct Functor_BatchedSerialTbsv { const std::string name_value_type = Test::value_type_name(); std::string name = name_region + name_value_type; Kokkos::Profiling::pushRegion(name.c_str()); - Kokkos::RangePolicy policy(0, _b.extent(0)); + Kokkos::RangePolicy policy(0, m_b.extent(0)); Kokkos::parallel_for(name.c_str(), policy, *this); Kokkos::Profiling::popRegion(); } @@ -126,8 +124,8 @@ void impl_test_batched_tbsv(const int N, const int k, const int BlkSize) { create_banded_triangular_matrix(Ref, Ab, k, true); // Reference trsv - Functor_BatchedSerialTrsv(1.0, A, - x0) + Functor_BatchedSerialTrsv(1.0, A, x0) .run(); // tbsv @@ -185,8 +183,8 @@ void impl_test_batched_tbsv_analytical(const std::size_t N) { } if (std::is_same_v) { - if (std::is_same_v) { - if (std::is_same_v) { + if (std::is_same_v) { + if (std::is_same_v) { x_ref(ib, 0) = 1.0 / 2.0; x_ref(ib, 1) = 1.0 / 6.0; x_ref(ib, 2) = 1.0 / 3.0; @@ -196,7 +194,7 @@ void impl_test_batched_tbsv_analytical(const std::size_t N) { x_ref(ib, 2) = 1.0; } } else { - if (std::is_same_v) { + if (std::is_same_v) { x_ref(ib, 0) = 1.0; x_ref(ib, 1) = 0.0; x_ref(ib, 2) = 0.0; @@ -207,8 +205,8 @@ void impl_test_batched_tbsv_analytical(const std::size_t N) { } } } else { - if (std::is_same_v) { - if (std::is_same_v) { + if (std::is_same_v) { + if (std::is_same_v) { x_ref(ib, 0) = 1.0; x_ref(ib, 1) = -1.0 / 2.0; x_ref(ib, 2) = -1.0 / 6.0; @@ -218,7 +216,7 @@ void impl_test_batched_tbsv_analytical(const std::size_t N) { x_ref(ib, 2) = 1.0; } } else { - if (std::is_same_v) { + if (std::is_same_v) { x_ref(ib, 0) = 0.0; x_ref(ib, 1) = 0.0; x_ref(ib, 2) = 1.0 / 3.0; @@ -245,37 +243,25 @@ void impl_test_batched_tbsv_analytical(const std::size_t N) { Kokkos::fence(); - // Check x0 = x_ref and x1 = x_ref - // Firstly, prepare contiguous views on host - auto h_x0 = Kokkos::create_mirror_view(x0); - auto h_x1 = Kokkos::create_mirror_view(x0); - - Kokkos::deep_copy(h_x0, x0); - - // Pack x1 into x0 for contiguous storage - Kokkos::parallel_for( - "KokkosBatched::Test::SerialTbsv::Copy", policy, KOKKOS_LAMBDA(const std::size_t ib) { - for (std::size_t j = 0; j < BlkSize; j++) { - x0(ib, j) = x1(ib, j); - } - }); - - Kokkos::fence(); - Kokkos::deep_copy(h_x1, x0); - - // this eps is about 10^-14 + // Check x0 = x_ref using ats = typename Kokkos::ArithTraits; using mag_type = typename ats::mag_type; mag_type eps = 1.0e3 * ats::epsilon(); + auto h_x0 = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), x0); auto h_x_ref = Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), x_ref); for (std::size_t ib = 0; ib < N; ib++) { for (std::size_t j = 0; j < BlkSize; j++) { - // Check x0 = x_ref EXPECT_NEAR_KK(h_x0(ib, j), h_x_ref(ib, j), eps); + } + } - // Check x1 = x_ref - EXPECT_NEAR_KK(h_x1(ib, j), h_x_ref(ib, j), eps); + // Testing for strided views x1, reusing x0 + Kokkos::deep_copy(x0, x1); + Kokkos::deep_copy(h_x0, x0); + for (std::size_t ib = 0; ib < N; ib++) { + for (std::size_t j = 0; j < BlkSize; j++) { + EXPECT_NEAR_KK(h_x0(ib, j), h_x_ref(ib, j), eps); } } } @@ -293,6 +279,7 @@ int test_batched_tbsv() { Test::Tbsv::impl_test_batched_tbsv(0, 1, 10); for (int i = 0; i < 10; i++) { Test::Tbsv::impl_test_batched_tbsv(1, 1, i); + Test::Tbsv::impl_test_batched_tbsv(2, 1, i); } } #endif @@ -304,6 +291,7 @@ int test_batched_tbsv() { Test::Tbsv::impl_test_batched_tbsv(0, 1, 10); for (int i = 0; i < 10; i++) { Test::Tbsv::impl_test_batched_tbsv(1, 1, i); + Test::Tbsv::impl_test_batched_tbsv(2, 1, i); } } #endif diff --git a/batched/dense/unit_test/Test_Batched_SerialTbsv_Complex.hpp b/batched/dense/unit_test/Test_Batched_SerialTbsv_Complex.hpp index 005a6e92c0..20403f963f 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTbsv_Complex.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTbsv_Complex.hpp @@ -14,91 +14,184 @@ // //@HEADER +#if defined(KOKKOSKERNELS_INST_COMPLEX_FLOAT) +// NO TRANSPOSE +TEST_F(TestCategory, batched_serial_tbsv_l_nt_u_fcomplex) { + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_l_nt_n_fcomplex) { + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_u_nt_u_fcomplex) { + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_u_nt_n_fcomplex) { + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +// TRANSPOSE +TEST_F(TestCategory, batched_serial_tbsv_l_t_u_fcomplex) { + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_l_t_n_fcomplex) { + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_u_t_u_fcomplex) { + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_u_t_n_fcomplex) { + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} + +// CONJUGATE TRANSPOSE +TEST_F(TestCategory, batched_serial_tbsv_l_ct_u_dcomplex) { + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_l_ct_n_dcomplex) { + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_u_ct_u_dcomplex) { + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +TEST_F(TestCategory, batched_serial_tbsv_u_ct_n_dcomplex) { + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; + + test_batched_tbsv, param_tag_type, algo_tag_type>(); +} +#endif + #if defined(KOKKOSKERNELS_INST_COMPLEX_DOUBLE) // NO TRANSPOSE TEST_F(TestCategory, batched_serial_tbsv_l_nt_u_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_l_nt_n_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; + using param_tag_type = ::Test::Tbsv::ParamTag; using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_u_nt_u_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_u_nt_n_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; + using param_tag_type = ::Test::Tbsv::ParamTag; using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } // TRANSPOSE TEST_F(TestCategory, batched_serial_tbsv_l_t_u_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_l_t_n_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_u_t_u_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_u_t_n_dcomplex) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv, param_tag_type, algo_tag_type>(); } -/* [FIXME] These tests need Trans::ConjTranspose in trsv. // CONJUGATE TRANSPOSE TEST_F(TestCategory, batched_serial_tbsv_l_ct_u_dcomplex) { - using param_tag_type = - ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; - test_batched_tbsv, param_tag_type, - algo_tag_type>(); + test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_l_ct_n_dcomplex) { - using param_tag_type = - ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; - test_batched_tbsv, param_tag_type, - algo_tag_type>(); + test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_u_ct_u_dcomplex) { - using param_tag_type = - ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; - test_batched_tbsv, param_tag_type, - algo_tag_type>(); + test_batched_tbsv, param_tag_type, algo_tag_type>(); } TEST_F(TestCategory, batched_serial_tbsv_u_ct_n_dcomplex) { - using param_tag_type = - ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; - test_batched_tbsv, param_tag_type, - algo_tag_type>(); + test_batched_tbsv, param_tag_type, algo_tag_type>(); } -*/ #endif diff --git a/batched/dense/unit_test/Test_Batched_SerialTbsv_Real.hpp b/batched/dense/unit_test/Test_Batched_SerialTbsv_Real.hpp index c8f10adf5c..75654f234e 100644 --- a/batched/dense/unit_test/Test_Batched_SerialTbsv_Real.hpp +++ b/batched/dense/unit_test/Test_Batched_SerialTbsv_Real.hpp @@ -17,51 +17,59 @@ #if defined(KOKKOSKERNELS_INST_FLOAT) // NO TRANSPOSE TEST_F(TestCategory, batched_serial_tbsv_l_nt_u_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_l_nt_n_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; + using param_tag_type = ::Test::Tbsv::ParamTag; using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_nt_u_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_nt_n_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; + using param_tag_type = ::Test::Tbsv::ParamTag; using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } // TRANSPOSE TEST_F(TestCategory, batched_serial_tbsv_l_t_u_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_l_t_n_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_t_u_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_t_n_float) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } @@ -70,51 +78,59 @@ TEST_F(TestCategory, batched_serial_tbsv_u_t_n_float) { #if defined(KOKKOSKERNELS_INST_DOUBLE) // NO TRANSPOSE TEST_F(TestCategory, batched_serial_tbsv_l_nt_u_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_l_nt_n_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; + using param_tag_type = ::Test::Tbsv::ParamTag; using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_nt_u_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_nt_n_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; + using param_tag_type = ::Test::Tbsv::ParamTag; using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } // TRANSPOSE TEST_F(TestCategory, batched_serial_tbsv_l_t_u_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_l_t_n_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_t_u_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); } TEST_F(TestCategory, batched_serial_tbsv_u_t_n_double) { - using param_tag_type = ::Test::Tbsv::ParamTag; - using algo_tag_type = typename Algo::Tbsv::Unblocked; + using param_tag_type = + ::Test::Tbsv::ParamTag; + using algo_tag_type = typename Algo::Tbsv::Unblocked; test_batched_tbsv(); }