diff --git a/blas/src/KokkosBlas1_dot.hpp b/blas/src/KokkosBlas1_dot.hpp index 6d87a70a08..4a5a18b976 100644 --- a/blas/src/KokkosBlas1_dot.hpp +++ b/blas/src/KokkosBlas1_dot.hpp @@ -75,11 +75,11 @@ dot(const XVector& x, const YVector& y) { using result_type = typename KokkosBlas::Impl::DotAccumulatingScalar::type; using RVector_Internal = - Kokkos::View>; + Kokkos::View>; using RVector_Result = - Kokkos::View>; + Kokkos::View>; result_type result{}; RVector_Result R = RVector_Result(&result); diff --git a/blas/src/KokkosBlas1_nrm1.hpp b/blas/src/KokkosBlas1_nrm1.hpp index 9481cd9472..62f373d7b8 100644 --- a/blas/src/KokkosBlas1_nrm1.hpp +++ b/blas/src/KokkosBlas1_nrm1.hpp @@ -39,19 +39,17 @@ nrm1(const XVector& x) { static_assert(XVector::rank == 1, "KokkosBlas::nrm1: " "Both Vector inputs must have rank 1."); - typedef typename Kokkos::Details::InnerProductSpaceTraits< - typename XVector::non_const_value_type>::mag_type mag_type; + using mag_type = typename Kokkos::Details::InnerProductSpaceTraits< + typename XVector::non_const_value_type>::mag_type; - typedef Kokkos::View< + using XVector_Internal = Kokkos::View< typename XVector::const_value_type*, typename KokkosKernels::Impl::GetUnifiedLayout::array_layout, - typename XVector::device_type, Kokkos::MemoryTraits > - XVector_Internal; + typename XVector::device_type, Kokkos::MemoryTraits >; - typedef Kokkos::View > - RVector_Internal; + using RVector_Internal = + Kokkos::View >; mag_type result; RVector_Internal R = RVector_Internal(&result); diff --git a/blas/src/KokkosBlas1_nrm2_squared.hpp b/blas/src/KokkosBlas1_nrm2_squared.hpp index 8f053fad47..3a584c8a99 100644 --- a/blas/src/KokkosBlas1_nrm2_squared.hpp +++ b/blas/src/KokkosBlas1_nrm2_squared.hpp @@ -49,8 +49,7 @@ nrm2_squared(const XVector& x) { typename XVector::device_type, Kokkos::MemoryTraits > XVector_Internal; - typedef Kokkos::View > RVector_Internal; diff --git a/blas/src/KokkosBlas1_nrm2w_squared.hpp b/blas/src/KokkosBlas1_nrm2w_squared.hpp index 62fa263ab0..a65dad9b0f 100644 --- a/blas/src/KokkosBlas1_nrm2w_squared.hpp +++ b/blas/src/KokkosBlas1_nrm2w_squared.hpp @@ -50,8 +50,7 @@ nrm2w_squared(const XVector& x, const XVector& w) { typename XVector::device_type, Kokkos::MemoryTraits > XVector_Internal; - typedef Kokkos::View > RVector_Internal; diff --git a/blas/unit_test/Test_Blas1_axpby.hpp b/blas/unit_test/Test_Blas1_axpby.hpp index 5ba19c7ce5..79a244fc6e 100644 --- a/blas/unit_test/Test_Blas1_axpby.hpp +++ b/blas/unit_test/Test_Blas1_axpby.hpp @@ -23,27 +23,33 @@ namespace Test { template void impl_test_axpby(int N) { - typedef typename ViewTypeA::value_type ScalarA; - typedef typename ViewTypeB::value_type ScalarB; + using ScalarA = typename ViewTypeA::value_type; + using ScalarB = typename ViewTypeB::value_type; + using MagnitudeB = typename Kokkos::ArithTraits::mag_type; - typedef Kokkos::View< + using BaseTypeA = Kokkos::View< ScalarA * [2], typename std::conditional::value, Kokkos::LayoutRight, Kokkos::LayoutLeft>::type, - Device> - BaseTypeA; - typedef Kokkos::View< + Device>; + using BaseTypeB = Kokkos::View< ScalarB * [2], typename std::conditional::value, Kokkos::LayoutRight, Kokkos::LayoutLeft>::type, - Device> - BaseTypeB; - - ScalarA a = 3; - ScalarB b = 5; - double eps = std::is_same::value ? 2 * 1e-5 : 1e-7; + Device>; + + ScalarA a = 3; + ScalarB b = 5; + // eps should probably be based on ScalarB since that is the type + // in which the result is computed. + const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB max_val = 10; + const MagnitudeB max_error = + (static_cast(Kokkos::ArithTraits::abs(a)) + + Kokkos::ArithTraits::abs(b)) * + max_val * eps; BaseTypeA b_x("X", N); BaseTypeB b_y("Y", N); @@ -67,12 +73,12 @@ void impl_test_axpby(int N) { { ScalarA randStart, randEnd; - Test::getRandomBounds(10.0, randStart, randEnd); + Test::getRandomBounds(max_val, randStart, randEnd); Kokkos::fill_random(b_x, rand_pool, randStart, randEnd); } { ScalarB randStart, randEnd; - Test::getRandomBounds(10.0, randStart, randEnd); + Test::getRandomBounds(max_val, randStart, randEnd); Kokkos::fill_random(b_y, rand_pool, randStart, randEnd); } @@ -85,7 +91,8 @@ void impl_test_axpby(int N) { KokkosBlas::axpby(a, x, b, y); Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) + b * h_b_org_y(i, 0), h_y(i), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i) + b * h_b_org_y(i, 0)), + h_y(i), 2 * max_error); } Kokkos::deep_copy(b_y, b_org_y); @@ -93,14 +100,16 @@ void impl_test_axpby(int N) { KokkosBlas::axpby(a, c_x, b, y); Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) + b * h_b_org_y(i, 0), h_y(i), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i) + b * h_b_org_y(i, 0)), + h_y(i), 2 * max_error); } } template void impl_test_axpby_mv(int N, int K) { - typedef typename ViewTypeA::value_type ScalarA; - typedef typename ViewTypeB::value_type ScalarB; + using ScalarA = typename ViewTypeA::value_type; + using ScalarB = typename ViewTypeB::value_type; + using MagnitudeB = typename Kokkos::ArithTraits::mag_type; typedef multivector_layout_adapter vfA_type; typedef multivector_layout_adapter vfB_type; @@ -121,6 +130,15 @@ void impl_test_axpby_mv(int N, int K) { typename ViewTypeA::HostMirror h_x = h_vfA_type::view(h_b_x); typename ViewTypeB::HostMirror h_y = h_vfB_type::view(h_b_y); + ScalarA a = 3; + ScalarB b = 5; + const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB max_val = 10; + const MagnitudeB max_error = + (static_cast(Kokkos::ArithTraits::abs(a)) + + Kokkos::ArithTraits::abs(b)) * + max_val * eps; + Kokkos::Random_XorShift64_Pool rand_pool( 13718); @@ -136,18 +154,15 @@ void impl_test_axpby_mv(int N, int K) { } Kokkos::deep_copy(b_org_y, b_y); - auto h_b_org_y = - Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), b_org_y); + ViewTypeB org_y = vfB_type::view(b_org_y); + auto h_org_y = + Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), org_y); Kokkos::deep_copy(h_b_x, b_x); Kokkos::deep_copy(h_b_y, b_y); - ScalarA a = 3; - ScalarB b = 5; typename ViewTypeA::const_type c_x = x; - double eps = std::is_same::value ? 2 * 1e-5 : 1e-7; - Kokkos::View r("Dot::Result", K); KokkosBlas::axpby(a, x, b, y); @@ -155,7 +170,8 @@ void impl_test_axpby_mv(int N, int K) { for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j) + b * h_b_org_y(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i, j) + b * h_org_y(i, j)), + h_y(i, j), 2 * max_error); } } @@ -165,7 +181,8 @@ void impl_test_axpby_mv(int N, int K) { for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j) + b * h_b_org_y(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i, j) + b * h_org_y(i, j)), + h_y(i, j), 2 * max_error); } } } diff --git a/blas/unit_test/Test_Blas1_axpy.hpp b/blas/unit_test/Test_Blas1_axpy.hpp index 35293652b5..890e116584 100644 --- a/blas/unit_test/Test_Blas1_axpy.hpp +++ b/blas/unit_test/Test_Blas1_axpy.hpp @@ -23,28 +23,30 @@ namespace Test { template void impl_test_axpy(int N) { - typedef typename ViewTypeA::value_type ScalarA; - typedef typename ViewTypeB::value_type ScalarB; + using ScalarA = typename ViewTypeA::value_type; + using ScalarB = typename ViewTypeB::value_type; + using MagnitudeB = typename Kokkos::ArithTraits::mag_type; - typedef Kokkos::View< + using BaseTypeA = Kokkos::View< ScalarA * [2], typename std::conditional::value, Kokkos::LayoutRight, Kokkos::LayoutLeft>::type, - Device> - BaseTypeA; - typedef Kokkos::View< + Device>; + using BaseTypeB = Kokkos::View< ScalarB * [2], typename std::conditional::value, Kokkos::LayoutRight, Kokkos::LayoutLeft>::type, - Device> - BaseTypeB; + Device>; - using MagnitudeA = typename Kokkos::ArithTraits::mag_type; - - ScalarA a = 3; - double eps = std::is_same::value ? 2e-5 : 1e-7; + ScalarA a = 3; + const MagnitudeB max_val = 10; + const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB max_error = + (static_cast(Kokkos::ArithTraits::abs(a)) * max_val + + max_val) * + eps; BaseTypeA b_x("X", N); BaseTypeB b_y("Y", N); @@ -66,12 +68,12 @@ void impl_test_axpy(int N) { { ScalarA randStart, randEnd; - Test::getRandomBounds(10.0, randStart, randEnd); + Test::getRandomBounds(max_val, randStart, randEnd); Kokkos::fill_random(x, rand_pool, randStart, randEnd); } { ScalarB randStart, randEnd; - Test::getRandomBounds(10.0, randStart, randEnd); + Test::getRandomBounds(max_val, randStart, randEnd); Kokkos::fill_random(y, rand_pool, randStart, randEnd); } @@ -86,7 +88,7 @@ void impl_test_axpy(int N) { for (int i = 0; i < N; i++) { ScalarB expected = a * h_x(i) + h_b_org_y(i, 0); - EXPECT_NEAR_KK(expected, h_y(i), eps); + EXPECT_NEAR_KK(expected, h_y(i), 2 * max_error); } // reset y to orig, and run again with const-valued x @@ -95,14 +97,15 @@ void impl_test_axpy(int N) { Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { ScalarB expected = a * h_x(i) + h_b_org_y(i, 0); - EXPECT_NEAR_KK(expected, h_y(i), eps); + EXPECT_NEAR_KK(expected, h_y(i), 2 * max_error); } } template void impl_test_axpy_mv(int N, int K) { - typedef typename ViewTypeA::value_type ScalarA; - typedef typename ViewTypeB::value_type ScalarB; + using ScalarA = typename ViewTypeA::value_type; + using ScalarB = typename ViewTypeB::value_type; + using MagnitudeB = typename Kokkos::ArithTraits::mag_type; typedef multivector_layout_adapter vfA_type; typedef multivector_layout_adapter vfB_type; @@ -123,37 +126,44 @@ void impl_test_axpy_mv(int N, int K) { typename ViewTypeA::HostMirror h_x = h_vfA_type::view(h_b_x); typename ViewTypeB::HostMirror h_y = h_vfB_type::view(h_b_y); + ScalarA a = 3; + const MagnitudeB eps = Kokkos::ArithTraits::epsilon(); + const MagnitudeB max_val = 10; + const MagnitudeB max_error = + (static_cast(Kokkos::ArithTraits::abs(a)) * max_val + + max_val) * + eps; + Kokkos::Random_XorShift64_Pool rand_pool( 13718); { ScalarA randStart, randEnd; - Test::getRandomBounds(10.0, randStart, randEnd); + Test::getRandomBounds(max_val, randStart, randEnd); Kokkos::fill_random(b_x, rand_pool, randStart, randEnd); } { ScalarB randStart, randEnd; - Test::getRandomBounds(10.0, randStart, randEnd); + Test::getRandomBounds(max_val, randStart, randEnd); Kokkos::fill_random(b_y, rand_pool, randStart, randEnd); } Kokkos::deep_copy(b_org_y, b_y); - auto h_b_org_y = - Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), b_org_y); + ViewTypeB org_y = vfB_type::view(b_org_y); + auto h_org_y = + Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), org_y); Kokkos::deep_copy(h_b_x, b_x); Kokkos::deep_copy(h_b_y, b_y); - ScalarA a = 3; typename ViewTypeA::const_type c_x = x; - double eps = std::is_same::value ? 2 * 1e-5 : 1e-7; - KokkosBlas::axpy(a, x, y); Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j) + h_b_org_y(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i, j) + h_org_y(i, j)), + h_y(i, j), 2 * max_error); } } @@ -162,7 +172,8 @@ void impl_test_axpy_mv(int N, int K) { Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j) + h_b_org_y(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i, j) + h_org_y(i, j)), + h_y(i, j), 2 * max_error); } } } diff --git a/blas/unit_test/Test_Blas1_dot.hpp b/blas/unit_test/Test_Blas1_dot.hpp index 044a9765d2..b2dfc1bd41 100644 --- a/blas/unit_test/Test_Blas1_dot.hpp +++ b/blas/unit_test/Test_Blas1_dot.hpp @@ -185,22 +185,26 @@ int test_dot() { // Test::impl_test_dot(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - Test::impl_test_dot(0); - Test::impl_test_dot(13); - Test::impl_test_dot(1024); - // Test::impl_test_dot(132231); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_dot(1024); - Test::impl_test_dot(1024); -#endif + // Removing the layout stride test as ViewTypeA a("a", N); + // is invalid since the view constructor needs a stride object! + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + typedef Kokkos::View view_type_b_ls; + Test::impl_test_dot(0); + Test::impl_test_dot(13); + Test::impl_test_dot(1024); + // Test::impl_test_dot(132231); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_dot(1024); + Test::impl_test_dot(1024); + #endif + */ return 1; } @@ -231,23 +235,28 @@ int test_dot_mv() { // Test::impl_test_dot_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - Test::impl_test_dot_mv(0, 5); - Test::impl_test_dot_mv(13, 5); - Test::impl_test_dot_mv(1024, 5); - Test::impl_test_dot_mv(789, 1); - // Test::impl_test_dot_mv(132231,5); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_dot_mv(1024, 5); - Test::impl_test_dot_mv(1024, 5); -#endif + // Removing the layout stride test as ViewTypeA a("a", N); + // is invalid since the view constructor needs a stride object! + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; typedef Kokkos::View + view_type_b_ls; Test::impl_test_dot_mv(0, 5); Test::impl_test_dot_mv(13, 5); Test::impl_test_dot_mv(1024, 5); Test::impl_test_dot_mv(789, 1); + // Test::impl_test_dot_mv(132231,5); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_dot_mv(1024, 5); + Test::impl_test_dot_mv(1024, 5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_iamax.hpp b/blas/unit_test/Test_Blas1_iamax.hpp index 1619512ceb..ced1759301 100644 --- a/blas/unit_test/Test_Blas1_iamax.hpp +++ b/blas/unit_test/Test_Blas1_iamax.hpp @@ -27,7 +27,7 @@ void impl_test_iamax(int N) { typedef typename AT::mag_type mag_type; using size_type = typename ViewTypeA::size_type; - ViewTypeA a("a", N); + ViewTypeA a("A", N); typename ViewTypeA::HostMirror h_a = Kokkos::create_mirror_view(a); @@ -240,15 +240,17 @@ int test_iamax() { // Test::impl_test_iamax(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_iamax(0); - Test::impl_test_iamax(13); - Test::impl_test_iamax(1024); - // Test::impl_test_iamax(132231); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + Test::impl_test_iamax(0); + Test::impl_test_iamax(13); + Test::impl_test_iamax(1024); + // Test::impl_test_iamax(132231); + #endif + */ return 1; } @@ -275,15 +277,17 @@ int test_iamax_mv() { // Test::impl_test_iamax_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_iamax_mv(0, 5); - Test::impl_test_iamax_mv(13, 5); - Test::impl_test_iamax_mv(1024, 5); - // Test::impl_test_iamax_mv(132231,5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; Test::impl_test_iamax_mv(0, 5); + Test::impl_test_iamax_mv(13, 5); + Test::impl_test_iamax_mv(1024, 5); + // Test::impl_test_iamax_mv(132231,5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_mult.hpp b/blas/unit_test/Test_Blas1_mult.hpp index c922cb295f..3c027f26e7 100644 --- a/blas/unit_test/Test_Blas1_mult.hpp +++ b/blas/unit_test/Test_Blas1_mult.hpp @@ -74,21 +74,24 @@ void impl_test_mult(int N) { KokkosBlas::mult(b, z, a, x, y); Kokkos::deep_copy(h_z, z); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) * h_y(i) + b * h_b_org_z(i), h_z(i), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i) * h_y(i) + b * h_b_org_z(i)), + h_z(i), eps); } Kokkos::deep_copy(z, b_org_z); KokkosBlas::mult(b, z, a, x, c_y); Kokkos::deep_copy(h_z, z); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) * h_y(i) + b * h_b_org_z(i), h_z(i), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i) * h_y(i) + b * h_b_org_z(i)), + h_z(i), eps); } Kokkos::deep_copy(z, b_org_z); KokkosBlas::mult(b, z, a, c_x, c_y); Kokkos::deep_copy(h_z, z); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) * h_y(i) + b * h_b_org_z(i), h_z(i), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i) * h_y(i) + b * h_b_org_z(i)), + h_z(i), eps); } } @@ -157,8 +160,9 @@ void impl_test_mult_mv(int N, int K) { Kokkos::deep_copy(h_b_z, b_z); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i) * h_y(i, j) + b * h_b_org_z(i, j), h_z(i, j), - eps); + EXPECT_NEAR_KK( + static_cast(a * h_x(i) * h_y(i, j) + b * h_b_org_z(i, j)), + h_z(i, j), eps); } } @@ -167,8 +171,9 @@ void impl_test_mult_mv(int N, int K) { Kokkos::deep_copy(h_b_z, b_z); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i) * h_y(i, j) + b * h_b_org_z(i, j), h_z(i, j), - eps); + EXPECT_NEAR_KK( + static_cast(a * h_x(i) * h_y(i, j) + b * h_b_org_z(i, j)), + h_z(i, j), eps); } } } @@ -208,29 +213,27 @@ int test_mult() { // Device>(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - typedef Kokkos::View view_type_c_ls; - Test::impl_test_mult( - 0); - Test::impl_test_mult( - 13); - Test::impl_test_mult( - 1024); - // Test::impl_test_mult(132231); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_mult( - 1024); - Test::impl_test_mult( - 1024); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + typedef Kokkos::View view_type_b_ls; + typedef Kokkos::View view_type_c_ls; + Test::impl_test_mult( 0); Test::impl_test_mult( 13); Test::impl_test_mult( 1024); + // Test::impl_test_mult(132231); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_mult( 1024); Test::impl_test_mult( 1024); #endif + */ return 1; } @@ -269,29 +272,30 @@ int test_mult_mv() { // Device>(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - typedef Kokkos::View view_type_c_ls; - Test::impl_test_mult_mv(0, 5); - Test::impl_test_mult_mv(13, 5); - Test::impl_test_mult_mv(1024, 5); - // Test::impl_test_mult_mv(132231,5); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_mult_mv(1024, 5); - Test::impl_test_mult_mv(1024, 5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + typedef Kokkos::View + view_type_b_ls; typedef Kokkos::View + view_type_c_ls; Test::impl_test_mult_mv(0, 5); Test::impl_test_mult_mv(13, 5); + Test::impl_test_mult_mv(1024, 5); + // Test::impl_test_mult_mv(132231,5); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_mult_mv(1024, 5); + Test::impl_test_mult_mv(1024, 5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_nrm1.hpp b/blas/unit_test/Test_Blas1_nrm1.hpp index 7b56dc94b3..b64aab9c3c 100644 --- a/blas/unit_test/Test_Blas1_nrm1.hpp +++ b/blas/unit_test/Test_Blas1_nrm1.hpp @@ -143,15 +143,17 @@ int test_nrm1() { Test::impl_test_nrm1(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrm1(0); - Test::impl_test_nrm1(13); - Test::impl_test_nrm1(1024); - Test::impl_test_nrm1(132231); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + Test::impl_test_nrm1(0); + Test::impl_test_nrm1(13); + Test::impl_test_nrm1(1024); + Test::impl_test_nrm1(132231); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_nrm2.hpp b/blas/unit_test/Test_Blas1_nrm2.hpp index 5cbc89488e..d17c9af505 100644 --- a/blas/unit_test/Test_Blas1_nrm2.hpp +++ b/blas/unit_test/Test_Blas1_nrm2.hpp @@ -139,15 +139,17 @@ int test_nrm2() { // Test::impl_test_nrm2(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrm2(0); - Test::impl_test_nrm2(13); - Test::impl_test_nrm2(1024); - // Test::impl_test_nrm2(132231); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + Test::impl_test_nrm2(0); + Test::impl_test_nrm2(13); + Test::impl_test_nrm2(1024); + // Test::impl_test_nrm2(132231); + #endif + */ return 1; } @@ -176,16 +178,18 @@ int test_nrm2_mv() { // Test::impl_test_nrm2_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrm2_mv(0, 5); - Test::impl_test_nrm2_mv(13, 5); - Test::impl_test_nrm2_mv(1024, 5); - Test::impl_test_nrm2_mv(789, 1); - // Test::impl_test_nrm2_mv(132231,5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; Test::impl_test_nrm2_mv(0, 5); + Test::impl_test_nrm2_mv(13, 5); + Test::impl_test_nrm2_mv(1024, 5); + Test::impl_test_nrm2_mv(789, 1); + // Test::impl_test_nrm2_mv(132231,5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_nrm2w.hpp b/blas/unit_test/Test_Blas1_nrm2w.hpp index b87c5ac48d..b91c5fbf78 100644 --- a/blas/unit_test/Test_Blas1_nrm2w.hpp +++ b/blas/unit_test/Test_Blas1_nrm2w.hpp @@ -137,15 +137,17 @@ int test_nrm2w() { // Test::impl_test_nrm2(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrm2w(0); - Test::impl_test_nrm2w(13); - Test::impl_test_nrm2w(1024); - // Test::impl_test_nrm2(132231); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + Test::impl_test_nrm2w(0); + Test::impl_test_nrm2w(13); + Test::impl_test_nrm2w(1024); + // Test::impl_test_nrm2(132231); + #endif + */ return 1; } @@ -174,16 +176,18 @@ int test_nrm2w_mv() { // Test::impl_test_nrm2w_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrm2w_mv(0, 5); - Test::impl_test_nrm2w_mv(13, 5); - Test::impl_test_nrm2w_mv(1024, 5); - Test::impl_test_nrm2w_mv(789, 1); - // Test::impl_test_nrm2w_mv(132231,5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; Test::impl_test_nrm2w_mv(0, 5); + Test::impl_test_nrm2w_mv(13, 5); + Test::impl_test_nrm2w_mv(1024, 5); + Test::impl_test_nrm2w_mv(789, 1); + // Test::impl_test_nrm2w_mv(132231,5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_nrm2w_squared.hpp b/blas/unit_test/Test_Blas1_nrm2w_squared.hpp index 3f76c84f30..59661cc7e5 100644 --- a/blas/unit_test/Test_Blas1_nrm2w_squared.hpp +++ b/blas/unit_test/Test_Blas1_nrm2w_squared.hpp @@ -133,15 +133,17 @@ int test_nrm2w_squared() { // Test::impl_test_nrm2(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrm2w_squared(0); - Test::impl_test_nrm2w_squared(13); - Test::impl_test_nrm2w_squared(1024); - // Test::impl_test_nrm2(132231); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + Test::impl_test_nrm2w_squared(0); + Test::impl_test_nrm2w_squared(13); + Test::impl_test_nrm2w_squared(1024); + // Test::impl_test_nrm2(132231); + #endif + */ return 1; } @@ -170,16 +172,18 @@ int test_nrm2w_squared_mv() { // Test::impl_test_nrm2w_squared_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrm2w_squared_mv(0, 5); - Test::impl_test_nrm2w_squared_mv(13, 5); - Test::impl_test_nrm2w_squared_mv(1024, 5); - Test::impl_test_nrm2w_squared_mv(789, 1); - // Test::impl_test_nrm2w_squared_mv(132231,5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; Test::impl_test_nrm2w_squared_mv(0, + 5); Test::impl_test_nrm2w_squared_mv(13, 5); + Test::impl_test_nrm2w_squared_mv(1024, 5); + Test::impl_test_nrm2w_squared_mv(789, 1); + // Test::impl_test_nrm2w_squared_mv(132231,5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_nrminf.hpp b/blas/unit_test/Test_Blas1_nrminf.hpp index b827dfa26e..8da5550afa 100644 --- a/blas/unit_test/Test_Blas1_nrminf.hpp +++ b/blas/unit_test/Test_Blas1_nrminf.hpp @@ -137,15 +137,17 @@ int test_nrminf() { // Test::impl_test_nrminf(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrminf(0); - Test::impl_test_nrminf(13); - Test::impl_test_nrminf(1024); - // Test::impl_test_nrminf(132231); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + Test::impl_test_nrminf(0); + Test::impl_test_nrminf(13); + Test::impl_test_nrminf(1024); + // Test::impl_test_nrminf(132231); + #endif + */ return 1; } @@ -172,15 +174,17 @@ int test_nrminf_mv() { // Test::impl_test_nrminf_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_nrminf_mv(0, 5); - Test::impl_test_nrminf_mv(13, 5); - Test::impl_test_nrminf_mv(1024, 5); - // Test::impl_test_nrminf_mv(132231,5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; Test::impl_test_nrminf_mv(0, 5); + Test::impl_test_nrminf_mv(13, 5); + Test::impl_test_nrminf_mv(1024, 5); + // Test::impl_test_nrminf_mv(132231,5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_reciprocal.hpp b/blas/unit_test/Test_Blas1_reciprocal.hpp index fdec530ee6..257429ac0d 100644 --- a/blas/unit_test/Test_Blas1_reciprocal.hpp +++ b/blas/unit_test/Test_Blas1_reciprocal.hpp @@ -212,22 +212,24 @@ int test_reciprocal() { // Test::impl_test_reciprocal(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - Test::impl_test_reciprocal(0); - Test::impl_test_reciprocal(13); - Test::impl_test_reciprocal(1024); - // Test::impl_test_reciprocal(132231); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_reciprocal(1024); - Test::impl_test_reciprocal(1024); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + typedef Kokkos::View view_type_b_ls; + Test::impl_test_reciprocal(0); + Test::impl_test_reciprocal(13); + Test::impl_test_reciprocal(1024); + // Test::impl_test_reciprocal(132231); #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_reciprocal(1024); + Test::impl_test_reciprocal(1024); + #endif + */ return 1; } @@ -260,26 +262,28 @@ int test_reciprocal_mv() { // Device>(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - Test::impl_test_reciprocal_mv(0, 5); - Test::impl_test_reciprocal_mv(13, 5); - Test::impl_test_reciprocal_mv(1024, - 5); - // Test::impl_test_reciprocal_mv(132231,5); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_reciprocal_mv(1024, - 5); - Test::impl_test_reciprocal_mv(1024, - 5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; typedef Kokkos::View + view_type_b_ls; Test::impl_test_reciprocal_mv(0, 5); Test::impl_test_reciprocal_mv(13, 5); Test::impl_test_reciprocal_mv(1024, 5); + // Test::impl_test_reciprocal_mv(132231,5); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_reciprocal_mv(1024, + 5); + Test::impl_test_reciprocal_mv(1024, + 5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_scal.hpp b/blas/unit_test/Test_Blas1_scal.hpp index 5fac67417f..1c572073a5 100644 --- a/blas/unit_test/Test_Blas1_scal.hpp +++ b/blas/unit_test/Test_Blas1_scal.hpp @@ -61,14 +61,14 @@ void impl_test_scal(int N) { KokkosBlas::scal(y, a, x); Kokkos::deep_copy(h_y, y); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i), h_y(i), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i)), h_y(i), eps); } Kokkos::deep_copy(y, org_y); KokkosBlas::scal(y, a, c_x); Kokkos::deep_copy(h_y, y); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i), h_y(i), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i)), h_y(i), eps); } } @@ -128,7 +128,7 @@ void impl_test_scal_mv(int N, int K) { Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i, j)), h_y(i, j), eps); } } @@ -137,7 +137,7 @@ void impl_test_scal_mv(int N, int K) { Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(a * h_x(i, j)), h_y(i, j), eps); } } @@ -156,7 +156,8 @@ void impl_test_scal_mv(int N, int K) { Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(h_params(j) * h_x(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(h_params(j) * h_x(i, j)), h_y(i, j), + eps); } } @@ -165,7 +166,8 @@ void impl_test_scal_mv(int N, int K) { Kokkos::deep_copy(h_b_y, b_y); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(h_params(j) * h_x(i, j), h_y(i, j), eps); + EXPECT_NEAR_KK(static_cast(h_params(j) * h_x(i, j)), h_y(i, j), + eps); } } } @@ -195,22 +197,24 @@ int test_scal() { // Test::impl_test_scal(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - Test::impl_test_scal(0); - Test::impl_test_scal(13); - Test::impl_test_scal(1024); - // Test::impl_test_scal(132231); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_scal(1024); - Test::impl_test_scal(1024); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + typedef Kokkos::View view_type_b_ls; + Test::impl_test_scal(0); + Test::impl_test_scal(13); + Test::impl_test_scal(1024); + // Test::impl_test_scal(132231); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_scal(1024); + Test::impl_test_scal(1024); + #endif + */ return 1; } @@ -239,22 +243,25 @@ int test_scal_mv() { // Test::impl_test_scal_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - Test::impl_test_scal_mv(0, 5); - Test::impl_test_scal_mv(13, 5); - Test::impl_test_scal_mv(1024, 5); - // Test::impl_test_scal_mv(132231,5); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_scal_mv(1024, 5); - Test::impl_test_scal_mv(1024, 5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; typedef Kokkos::View + view_type_b_ls; Test::impl_test_scal_mv(0, 5); Test::impl_test_scal_mv(13, 5); Test::impl_test_scal_mv(1024, 5); + // Test::impl_test_scal_mv(132231,5); #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_scal_mv(1024, 5); + Test::impl_test_scal_mv(1024, 5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_sum.hpp b/blas/unit_test/Test_Blas1_sum.hpp index d2ccd4bf3d..4472f8d204 100644 --- a/blas/unit_test/Test_Blas1_sum.hpp +++ b/blas/unit_test/Test_Blas1_sum.hpp @@ -128,15 +128,17 @@ int test_sum() { // Test::impl_test_sum(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_sum(0); - Test::impl_test_sum(13); - Test::impl_test_sum(1024); - // Test::impl_test_sum(132231); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + Test::impl_test_sum(0); + Test::impl_test_sum(13); + Test::impl_test_sum(1024); + // Test::impl_test_sum(132231); + #endif + */ return 1; } @@ -165,16 +167,18 @@ int test_sum_mv() { // Test::impl_test_sum_mv(132231,5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - Test::impl_test_sum_mv(0, 5); - Test::impl_test_sum_mv(13, 5); - Test::impl_test_sum_mv(1024, 5); - Test::impl_test_sum_mv(789, 1); - // Test::impl_test_sum_mv(132231,5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; Test::impl_test_sum_mv(0, 5); + Test::impl_test_sum_mv(13, 5); + Test::impl_test_sum_mv(1024, 5); + Test::impl_test_sum_mv(789, 1); + // Test::impl_test_sum_mv(132231,5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas1_team_update.hpp b/blas/unit_test/Test_Blas1_team_update.hpp index efb743bc0a..cf118e7ba2 100644 --- a/blas/unit_test/Test_Blas1_team_update.hpp +++ b/blas/unit_test/Test_Blas1_team_update.hpp @@ -102,8 +102,8 @@ void impl_test_team_update(int N) { ScalarA expected_result = 0; for (int i = 0; i < N; i++) - expected_result += ScalarB(c * h_z(i) + a * h_x(i) + b * h_y(i)) * - ScalarB(c * h_z(i) + a * h_x(i) + b * h_y(i)); + expected_result += ScalarC(c * h_z(i) + a * h_x(i) + b * h_y(i)) * + ScalarC(c * h_z(i) + a * h_x(i) + b * h_y(i)); // KokkosBlas::update(a,x,b,y,c,z); Kokkos::parallel_for( diff --git a/blas/unit_test/Test_Blas1_update.hpp b/blas/unit_test/Test_Blas1_update.hpp index 5a0d27cf42..189dc2afb6 100644 --- a/blas/unit_test/Test_Blas1_update.hpp +++ b/blas/unit_test/Test_Blas1_update.hpp @@ -104,21 +104,27 @@ void impl_test_update(int N) { KokkosBlas::update(a, x, b, y, c, z); Kokkos::deep_copy(h_b_z, b_z); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) + b * h_y(i) + c * h_org_z(i), h_z(i), eps); + EXPECT_NEAR_KK( + static_cast(a * h_x(i) + b * h_y(i) + c * h_org_z(i)), h_z(i), + eps); } Kokkos::deep_copy(b_z, b_org_z); KokkosBlas::update(a, c_x, b, y, c, z); Kokkos::deep_copy(h_b_z, b_z); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) + b * h_y(i) + c * h_org_z(i), h_z(i), eps); + EXPECT_NEAR_KK( + static_cast(a * h_x(i) + b * h_y(i) + c * h_org_z(i)), h_z(i), + eps); } Kokkos::deep_copy(b_z, b_org_z); KokkosBlas::update(a, c_x, b, c_y, c, z); Kokkos::deep_copy(h_b_z, b_z); for (int i = 0; i < N; i++) { - EXPECT_NEAR_KK(a * h_x(i) + b * h_y(i) + c * h_org_z(i), h_z(i), eps); + EXPECT_NEAR_KK( + static_cast(a * h_x(i) + b * h_y(i) + c * h_org_z(i)), h_z(i), + eps); } } @@ -192,7 +198,8 @@ void impl_test_update_mv(int N, int K) { Kokkos::deep_copy(h_b_z, b_z); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j) + b * h_y(i, j) + c * h_b_org_z(i, j), + EXPECT_NEAR_KK(static_cast(a * h_x(i, j) + b * h_y(i, j) + + c * h_b_org_z(i, j)), h_z(i, j), eps); } } @@ -202,7 +209,8 @@ void impl_test_update_mv(int N, int K) { Kokkos::deep_copy(h_b_z, b_z); for (int i = 0; i < N; i++) { for (int j = 0; j < K; j++) { - EXPECT_NEAR_KK(a * h_x(i, j) + b * h_y(i, j) + c * h_b_org_z(i, j), + EXPECT_NEAR_KK(static_cast(a * h_x(i, j) + b * h_y(i, j) + + c * h_b_org_z(i, j)), h_z(i, j), eps); } } @@ -243,29 +251,31 @@ int test_update() { // Device>(132231); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - typedef Kokkos::View view_type_c_ls; - Test::impl_test_update(0); - Test::impl_test_update(13); - Test::impl_test_update(1024); - // Test::impl_test_update(132231); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_update(1024); - Test::impl_test_update(1024); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View view_type_a_ls; + typedef Kokkos::View view_type_b_ls; + typedef Kokkos::View view_type_c_ls; + Test::impl_test_update(0); + Test::impl_test_update(13); + Test::impl_test_update(1024); + // Test::impl_test_update(132231); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_update(1024); + Test::impl_test_update(1024); + #endif + */ return 1; } @@ -304,29 +314,30 @@ int test_update_mv() { Device>(132231, 5); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - typedef Kokkos::View view_type_c_ls; - Test::impl_test_update_mv(0, 5); - Test::impl_test_update_mv(13, 5); - Test::impl_test_update_mv(1024, 5); - Test::impl_test_update_mv(132231, 5); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_update_mv(1024, 5); - Test::impl_test_update_mv(1024, 5); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; typedef Kokkos::View + view_type_b_ls; typedef Kokkos::View + view_type_c_ls; Test::impl_test_update_mv(0, 5); Test::impl_test_update_mv(13, 5); + Test::impl_test_update_mv(1024, 5); + Test::impl_test_update_mv(132231, 5); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_update_mv(1024, 5); + Test::impl_test_update_mv(1024, 5); + #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas2_gemv.hpp b/blas/unit_test/Test_Blas2_gemv.hpp index 4e8c53e7e6..1df115d2c3 100644 --- a/blas/unit_test/Test_Blas2_gemv.hpp +++ b/blas/unit_test/Test_Blas2_gemv.hpp @@ -203,37 +203,33 @@ int test_gemv(const char* mode) { // Device>(mode,132231,1024); #endif -#if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ - (!defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) - typedef Kokkos::View view_type_a_ls; - typedef Kokkos::View view_type_b_ls; - typedef Kokkos::View view_type_c_ls; - Test::impl_test_gemv( - mode, 0, 1024); - Test::impl_test_gemv( - mode, 1024, 0); - Test::impl_test_gemv( - mode, 13, 13); - Test::impl_test_gemv( - mode, 13, 1024); - Test::impl_test_gemv( - mode, 50, 40); - Test::impl_test_gemv( - mode, 1024, 1024); - Test::impl_test_gemv( - mode, 2131, 2131); - // Test::impl_test_gemv(mode,132231,1024); -#endif - -#if !defined(KOKKOSKERNELS_ETI_ONLY) && \ - !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) - Test::impl_test_gemv( - mode, 1024, 1024); - Test::impl_test_gemv( - mode, 1024, 1024); -#endif + /* + #if defined(KOKKOSKERNELS_INST_LAYOUTSTRIDE) || \ + (!defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) + typedef Kokkos::View + view_type_a_ls; typedef Kokkos::View + view_type_b_ls; typedef Kokkos::View + view_type_c_ls; Test::impl_test_gemv( mode, 0, 1024); Test::impl_test_gemv( mode, 1024, 0); + Test::impl_test_gemv( mode, 13, 13); Test::impl_test_gemv( mode, 13, 1024); Test::impl_test_gemv( mode, 50, 40); + Test::impl_test_gemv( mode, 1024, 1024); Test::impl_test_gemv( mode, 2131, 2131); + // Test::impl_test_gemv(mode,132231,1024); + #endif + + #if !defined(KOKKOSKERNELS_ETI_ONLY) && \ + !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS) + Test::impl_test_gemv( mode, 1024, 1024); Test::impl_test_gemv( mode, 1024, 1024); #endif + */ return 1; } diff --git a/blas/unit_test/Test_Blas2_gemv_util.hpp b/blas/unit_test/Test_Blas2_gemv_util.hpp index ba0392b2e1..99b4516cff 100644 --- a/blas/unit_test/Test_Blas2_gemv_util.hpp +++ b/blas/unit_test/Test_Blas2_gemv_util.hpp @@ -276,7 +276,7 @@ struct GEMVTest { // fetch GEMV functor from the factory using op_type = typename GemvFunc::template functor_type; + ViewTypeY, Device, ScalarType>; op_type gemv_op(trans, alpha, A, x, beta, y); Kokkos::parallel_for(Kokkos::TeamPolicy(1, 1), gemv_op); diff --git a/blas/unit_test/Test_Blas3_gemm.hpp b/blas/unit_test/Test_Blas3_gemm.hpp index 8ab92e25b1..a210806929 100644 --- a/blas/unit_test/Test_Blas3_gemm.hpp +++ b/blas/unit_test/Test_Blas3_gemm.hpp @@ -394,6 +394,26 @@ void test_gemm_enabled_layouts() { #endif } +template +void test_gemm_mixed_scalars() { + using Matrix1 = Kokkos::View; + using Matrix2 = Kokkos::View; + + const int dim1 = 400, dim2 = 1000; + + Matrix1 A("A", dim1, dim1); + Matrix1 B("B", dim2, dim2); + Matrix1 C("C", dim2, dim1); + Matrix2 D("D", dim2, dim1); + + Kokkos::deep_copy(A, Kokkos::ArithTraits::one()); + Kokkos::deep_copy(B, Kokkos::ArithTraits::one()); + Kokkos::deep_copy(C, Kokkos::ArithTraits::one()); + + KokkosBlas::gemm(TestExecSpace(), "N", "N", 1.0, D, A, 0.0, C); + KokkosBlas::gemm(TestExecSpace(), "N", "T", 1.0, C, D, 0.0, B); +} + #if defined(KOKKOSKERNELS_INST_FLOAT) || \ (!defined(KOKKOSKERNELS_ETI_ONLY) && \ !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS)) @@ -433,3 +453,23 @@ TEST_F(TestCategory, gemm_complex_float) { Kokkos::Profiling::popRegion(); } #endif + +#if defined(KOKKOSKERNELS_INST_COMPLEX_DOUBLE) && \ + !defined(KOKKOSKERNELS_ETI_ONLY) +TEST_F(TestCategory, gemm_mixed_scalars_complex_double_double) { + Kokkos::Profiling::pushRegion( + "KokkosBlas::Test::gemm_mixed_complex_double_double"); + test_gemm_mixed_scalars, double>(); + Kokkos::Profiling::popRegion(); +} +#endif + +#if defined(KOKKOSKERNELS_INST_COMPLEX_FLOAT) && \ + !defined(KOKKOSKERNELS_ETI_ONLY) +TEST_F(TestCategory, gemm_mixed_scalar_complex_float_float) { + Kokkos::Profiling::pushRegion( + "KokkosBlas::Test::gemm_mixed_complex_float_float"); + test_gemm_mixed_scalars, float>(); + Kokkos::Profiling::popRegion(); +} +#endif diff --git a/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp b/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp index 4ccdf7b07e..aa8af73d69 100644 --- a/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp +++ b/sparse/impl/KokkosSparse_par_ilut_numeric_impl.hpp @@ -31,8 +31,6 @@ #include -//#define NUMERIC_OUTPUT_INFO - namespace KokkosSparse { namespace Impl { namespace Experimental { @@ -931,8 +929,10 @@ struct IlutWrap { const index_t l_nnz = L_new_values.extent(0); const index_t u_nnz = U_new_values.extent(0); - const auto l_filter_rank = std::max(0, l_nnz - l_nnz_limit - 1); - const auto u_filter_rank = std::max(0, u_nnz - u_nnz_limit - 1); + const auto l_filter_rank = + std::max(static_cast(0), l_nnz - l_nnz_limit - 1); + const auto u_filter_rank = + std::max(static_cast(0), u_nnz - u_nnz_limit - 1); const auto l_threshold = threshold_select(L_new_values, l_filter_rank, V_copy); diff --git a/sparse/unit_test/Test_Sparse_spmv.hpp b/sparse/unit_test/Test_Sparse_spmv.hpp index 8c4dc6a3c5..d0a6d1464c 100644 --- a/sparse/unit_test/Test_Sparse_spmv.hpp +++ b/sparse/unit_test/Test_Sparse_spmv.hpp @@ -1000,7 +1000,7 @@ void test_github_issue_101() { constexpr double ONE_d = static_cast(1.0); constexpr double TWO_d = static_cast(2.0); - double_matrix_type A_d("A_d", G); + double_matrix_type A_d("A_d", G, numCols); auto A_d_val_h = Kokkos::create_mirror_view(A_d.values); A_d_val_h[0] = ONE_d; // This cast is deliberate; we want to use float eps here, but as @@ -1048,7 +1048,7 @@ void test_github_issue_101() { constexpr float TWO_f = static_cast(2.0); constexpr double ZERO_d = static_cast(0.0); - float_matrix_type A_f("A_f", G); + float_matrix_type A_f("A_f", G, numCols); auto A_f_val_h = Kokkos::create_mirror_view(A_f.values); A_f_val_h[0] = ONE_f; A_f_val_h[1] = EPS_f / TWO_f; diff --git a/sparse/unit_test/Test_Sparse_spmv_bsr.hpp b/sparse/unit_test/Test_Sparse_spmv_bsr.hpp index b9e5334abf..ccbcb21301 100644 --- a/sparse/unit_test/Test_Sparse_spmv_bsr.hpp +++ b/sparse/unit_test/Test_Sparse_spmv_bsr.hpp @@ -513,11 +513,10 @@ void testSpMVBsrMatrix() { Test_Bsr::check_bsrm_times_v( &mode, alpha_s, beta_s, bMax, num_errors); if (num_errors > 0) { - printf( - "KokkosSparse::Test::spmv_bsr: %i errors of %i with params: " - "%c %lf %lf\n", - num_errors, bMax, mode, Kokkos::ArithTraits::abs(alpha_s), - Kokkos::ArithTraits::abs(beta_s)); + std::cout << "KokkosSparse::Test::spmv_bsr: " << num_errors + << " errors of %i with params: " << bMax << " " << mode << " " + << Kokkos::ArithTraits::abs(alpha_s) << " " + << Kokkos::ArithTraits::abs(beta_s) << std::endl; } EXPECT_TRUE(num_errors == 0); } @@ -555,11 +554,10 @@ void testBsrMatrix_SpM_MV() { Test_Bsr::check_bsrm_times_mv( &mode, alpha_s, beta_s, bMax, num_errors); if (num_errors > 0) { - printf( - "KokkosSparse::Test::spm_mv_bsr: %i errors of %i with params: " - "%c %lf %lf\n", - num_errors, bMax, mode, Kokkos::ArithTraits::abs(alpha_s), - Kokkos::ArithTraits::abs(beta_s)); + std::cout << "KokkosSparse::Test::spm_mv_bsr: " << num_errors + << " errors of " << bMax << " with params: " << mode << " " + << Kokkos::ArithTraits::abs(alpha_s) << " " + << Kokkos::ArithTraits::abs(beta_s) << std::endl; } EXPECT_TRUE(num_errors == 0); }