Skip to content

Commit 9554c24

Browse files
authored
Lapack - SVD: fixing build issue, will look at test tomorrow (kokkos#2640)
* Lapack - SVD: fixing build issue, will look at test tomorrow Modifying the ETI specialization to make it consistent with a LayoutLeft vector view. Fixing some issue in RK unit-test. Signed-off-by: Luc Berger-Vergiat <[email protected]> * Lapack - svd: removing tests for layout right and guarding m < n Cuda and all other TPLs only support layout left so no point in testing for layout right, additionally Cuda only supports m >= n use case so I am guarding the tests with matrices where m < n. Signed-off-by: Luc Berger-Vergiat <[email protected]> * Applying clang-format Signed-off-by: Luc Berger-Vergiat <[email protected]> --------- Signed-off-by: Luc Berger-Vergiat <[email protected]>
1 parent 53e1a92 commit 9554c24

File tree

4 files changed

+21
-35
lines changed

4 files changed

+21
-35
lines changed

lapack/impl/KokkosLapack_svd_spec.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ struct svd_eti_spec_avail {
4848
EXEC_SPACE_TYPE, \
4949
Kokkos::View<SCALAR_TYPE **, LAYOUT_TYPE, Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
5050
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
51-
Kokkos::View<Kokkos::ArithTraits<SCALAR_TYPE>::mag_type *, LAYOUT_TYPE, \
51+
Kokkos::View<Kokkos::ArithTraits<SCALAR_TYPE>::mag_type *, Kokkos::LayoutLeft, \
5252
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
5353
Kokkos::View<SCALAR_TYPE **, LAYOUT_TYPE, Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
5454
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
@@ -106,7 +106,7 @@ struct SVD<ExecutionSpace, AMatrix, SVector, UMatrix, VMatrix, false, KOKKOSKERN
106106
EXEC_SPACE_TYPE, \
107107
Kokkos::View<SCALAR_TYPE **, LAYOUT_TYPE, Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
108108
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
109-
Kokkos::View<Kokkos::ArithTraits<SCALAR_TYPE>::mag_type *, LAYOUT_TYPE, \
109+
Kokkos::View<Kokkos::ArithTraits<SCALAR_TYPE>::mag_type *, Kokkos::LayoutLeft, \
110110
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
111111
Kokkos::View<SCALAR_TYPE **, LAYOUT_TYPE, Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
112112
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
@@ -119,7 +119,7 @@ struct SVD<ExecutionSpace, AMatrix, SVector, UMatrix, VMatrix, false, KOKKOSKERN
119119
EXEC_SPACE_TYPE, \
120120
Kokkos::View<SCALAR_TYPE **, LAYOUT_TYPE, Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
121121
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
122-
Kokkos::View<Kokkos::ArithTraits<SCALAR_TYPE>::mag_type *, LAYOUT_TYPE, \
122+
Kokkos::View<Kokkos::ArithTraits<SCALAR_TYPE>::mag_type *, Kokkos::LayoutLeft, \
123123
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
124124
Kokkos::View<SCALAR_TYPE **, LAYOUT_TYPE, Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
125125
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \

lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@
2020
#include "KokkosKernels_Error.hpp"
2121
#include "Kokkos_ArithTraits.hpp"
2222

23+
#include <iostream>
24+
2325
namespace KokkosLapack {
2426
namespace Impl {
2527
template <class ExecutionSpace, class AMatrix, class SVector, class UMatrix, class VMatrix>

lapack/unit_test/Test_Lapack_svd.hpp

Lines changed: 15 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,15 @@ int test_svd() {
507507
ret = Test::impl_analytic_2x2_svd<view_type_a_layout_left, Device>();
508508
EXPECT_EQ(ret, 0);
509509

510-
ret = Test::impl_analytic_2x3_svd<view_type_a_layout_left, Device>();
510+
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSOLVER)
511+
if constexpr (!std::is_same_v<typename Device::execution_space, Kokkos::Cuda>) {
512+
// cusolver only supports m > n so this should not be tested
513+
ret = Test::impl_analytic_2x3_svd<view_type_a_layout_left, Device>();
514+
EXPECT_EQ(ret, 0);
515+
}
516+
#endif
517+
518+
ret = Test::impl_analytic_3x2_svd<view_type_a_layout_left, Device>();
511519
EXPECT_EQ(ret, 0);
512520

513521
ret = Test::impl_test_svd<view_type_a_layout_left, Device>(0, 0);
@@ -525,37 +533,13 @@ int test_svd() {
525533
ret = Test::impl_test_svd<view_type_a_layout_left, Device>(100, 70);
526534
EXPECT_EQ(ret, 0);
527535

528-
ret = Test::impl_test_svd<view_type_a_layout_left, Device>(70, 100);
529-
EXPECT_EQ(ret, 0);
536+
#if defined(KOKKOSKERNELS_ENABLE_TPL_CUSOLVER)
537+
if constexpr (!std::is_same_v<typename Device::execution_space, Kokkos::Cuda>) {
538+
// cusolver only supports m > n so this should not be tested
539+
ret = Test::impl_test_svd<view_type_a_layout_left, Device>(70, 100);
540+
EXPECT_EQ(ret, 0);
541+
}
530542
#endif
531-
532-
#if defined(KOKKOSKERNELS_INST_LAYOUTRIGHT) || \
533-
(!defined(KOKKOSKERNELS_ETI_ONLY) && !defined(KOKKOSKERNELS_IMPL_CHECK_ETI_CALLS))
534-
using view_type_a_layout_right = Kokkos::View<ScalarA**, Kokkos::LayoutRight, Device>;
535-
536-
ret = Test::impl_analytic_2x2_svd<view_type_a_layout_right, Device>();
537-
EXPECT_EQ(ret, 0);
538-
539-
ret = Test::impl_analytic_2x3_svd<view_type_a_layout_right, Device>();
540-
EXPECT_EQ(ret, 0);
541-
542-
ret = Test::impl_test_svd<view_type_a_layout_right, Device>(0, 0);
543-
EXPECT_EQ(ret, 0);
544-
545-
ret = Test::impl_test_svd<view_type_a_layout_right, Device>(1, 1);
546-
EXPECT_EQ(ret, 0);
547-
548-
ret = Test::impl_test_svd<view_type_a_layout_right, Device>(15, 15);
549-
EXPECT_EQ(ret, 0);
550-
551-
ret = Test::impl_test_svd<view_type_a_layout_right, Device>(100, 100);
552-
EXPECT_EQ(ret, 0);
553-
554-
ret = Test::impl_test_svd<view_type_a_layout_right, Device>(100, 70);
555-
EXPECT_EQ(ret, 0);
556-
557-
ret = Test::impl_test_svd<view_type_a_layout_right, Device>(70, 100);
558-
EXPECT_EQ(ret, 0);
559543
#endif
560544

561545
return 1;

ode/unit_test/Test_ODE_RK.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ struct RKSolve_wrapper {
8484
ode_type my_ode;
8585
ode_params params;
8686
scalar_type tstart, tend;
87-
int max_steps;
87+
// int max_steps;
8888
vec_type y_old, y_new, tmp;
8989
mv_type kstack;
9090
count_type count;

0 commit comments

Comments
 (0)