Skip to content

Commit

Permalink
KokkosLapack_svd_tpl_spec_decl: disambiguate lapack vs mkl tpl
Browse files Browse the repository at this point in the history
In Trilinos, enable of MKL and LAPACK TPLs results in compilation errors due to redefinition of `struct KokkosLapack::Impl::SVD`,
reported in trilinos/Trilinos#12891
The changes here defer to the MKL tpl (when both LAPACK and MKL are enabled) by setting the `tpl_spec_avail` template parameter of the LAPACK SVD specialization to false, disambiguating from the MKL specialization (which will be set true)
  • Loading branch information
ndellingwood committed Apr 5, 2024
1 parent 2e6d98d commit f8d48fe
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lapack/tpls/KokkosLapack_svd_tpl_spec_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,14 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[],
}
}

constexpr bool svd_tpl_lapack_enable() {
#ifdef KOKKOSKERNELS_ENABLE_TPL_MKL
return false;
#else
return true;
#endif
}

#define KOKKOSLAPACK_SVD_LAPACK(SCALAR, LAYOUT, EXEC_SPACE) \
template <> \
struct SVD< \
Expand All @@ -125,7 +133,7 @@ void lapackSvdWrapper(const ExecutionSpace& /* space */, const char jobu[],
Kokkos::View<SCALAR**, LAYOUT, \
Kokkos::Device<EXEC_SPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
true, \
svd_tpl_lapack_enable(), \
svd_eti_spec_avail< \
EXEC_SPACE, \
Kokkos::View<SCALAR**, LAYOUT, \
Expand Down

0 comments on commit f8d48fe

Please sign in to comment.