Skip to content

Commit

Permalink
NRM1: refactoring TPL layer a bit with c++17 if constexpr
Browse files Browse the repository at this point in the history
Hopefully this leads to simpler code, less duplication, less
macro and easier maintenance!
Adding support for oneapi MKL while making tpl layer changes.
  • Loading branch information
lucbv committed Nov 20, 2023
1 parent 5a36d57 commit 5948d04
Show file tree
Hide file tree
Showing 3 changed files with 335 additions and 479 deletions.
34 changes: 34 additions & 0 deletions blas/tpls/KokkosBlas1_nrm1_tpl_spec_avail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,40 @@ KOKKOSBLAS1_NRM1_TPL_SPEC_AVAIL_ROCBLAS(Kokkos::complex<float>,

#endif // KOKKOSKERNELS_ENABLE_TPL_ROCBLAS

// oneMKL
#ifdef KOKKOSKERNELS_ENABLE_TPL_MKL

#if defined(KOKKOS_ENABLE_SYCL) && \
!defined(KOKKOSKERNELS_ENABLE_TPL_MKL_SYCL_OVERRIDE)

#define KOKKOSBLAS1_NRM1_TPL_SPEC_AVAIL_MKL_SYCL(SCALAR, LAYOUT, MEMSPACE) \
template <class ExecSpace> \
struct nrm1_tpl_spec_avail< \
ExecSpace, \
Kokkos::View< \
typename Kokkos::Details::InnerProductSpaceTraits<SCALAR>::mag_type, \
LAYOUT, Kokkos::HostSpace, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const SCALAR*, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
1> { \
enum : bool { value = true }; \
};

KOKKOSBLAS1_NRM1_TPL_SPEC_AVAIL_MKL_SYCL(
double, Kokkos::LayoutLeft, Kokkos::Experimental::SYCLDeviceUSMSpace)
KOKKOSBLAS1_NRM1_TPL_SPEC_AVAIL_MKL_SYCL(
float, Kokkos::LayoutLeft, Kokkos::Experimental::SYCLDeviceUSMSpace)
KOKKOSBLAS1_NRM1_TPL_SPEC_AVAIL_MKL_SYCL(
Kokkos::complex<double>, Kokkos::LayoutLeft,
Kokkos::Experimental::SYCLDeviceUSMSpace)
KOKKOSBLAS1_NRM1_TPL_SPEC_AVAIL_MKL_SYCL(
Kokkos::complex<float>, Kokkos::LayoutLeft,
Kokkos::Experimental::SYCLDeviceUSMSpace)

#endif // KOKKOS_ENABLE_SYCL
#endif // KOKKOSKERNELS_ENABLE_TPL_MKL

} // namespace Impl
} // namespace KokkosBlas
#endif
Loading

0 comments on commit 5948d04

Please sign in to comment.