Skip to content

Commit

Permalink
Fixup move explicit specialization out of Algo::Level{2,3}::Blocked t…
Browse files Browse the repository at this point in the history
…o compile with NVCC
  • Loading branch information
dalg24 committed Jan 18, 2022
1 parent 019f01b commit 8333dfa
Showing 1 changed file with 58 additions and 52 deletions.
110 changes: 58 additions & 52 deletions src/batched/KokkosBatched_Util.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -303,6 +303,60 @@ struct Mode {
};
};

#if !defined(KOKKOS_IF_HOST)

template <class>
struct algo_level3_blocked_mb_impl;
template <>
struct algo_level3_blocked_mb_impl<Kokkos::HostSpace> {
static constexpr int value = 4;
};
#if defined(KOKKOS_ENABLE_CUDA)
template <>
struct algo_level3_blocked_mb_impl<Kokkos::CudaSpace> {
static constexpr int value = 1;
};
#endif
#if defined(KOKKOS_ENABLE_HIP)
template <>
struct algo_level3_blocked_mb_impl<Kokkos::Experimental::HIPSpace> {
static constexpr int value = 1;
};
#endif
#if defined(KOKKOS_ENABLE_SYCL)
template <>
struct algo_level3_blocked_mb_impl<Kokkos::Experimental::SYCLDeviceUSMSpace> {
static constexpr int value = 1;
};
#endif

template <class>
struct algo_level2_blocked_mb_impl;
template <>
struct algo_level2_blocked_mb_impl<Kokkos::HostSpace> {
static constexpr int value = 4;
};
#if defined(KOKKOS_ENABLE_CUDA)
template <>
struct algo_level2_blocked_mb_impl<Kokkos::CudaSpace> {
static constexpr int value = 2;
};
#endif
#if defined(KOKKOS_ENABLE_HIP)
template <>
struct algo_level2_blocked_mb_impl<Kokkos::Experimental::HIPSpace> {
static constexpr int value = 2;
};
#endif
#if defined(KOKKOS_ENABLE_SYCL)
template <>
struct algo_level2_blocked_mb_impl<Kokkos::Experimental::SYCLDeviceUSMSpace> {
static constexpr int value = 2;
};
#endif

#endif

struct Algo {
struct Level3 {
struct Unblocked {
Expand All @@ -324,34 +378,10 @@ struct Algo {

#else // FIXME remove when requiring minimum version of Kokkos 3.6
static constexpr KOKKOS_FUNCTION int mb() {
return mb_impl<Kokkos::Impl::ActiveExecutionMemorySpace>::value;
return algo_level3_blocked_mb_impl<
Kokkos::Impl::ActiveExecutionMemorySpace>::value;
}

private:
template <class>
struct mb_impl;
template <>
struct mb_impl<Kokkos::HostSpace> {
static constexpr int value = 4;
};
#if defined(KOKKOS_ENABLE_CUDA)
template <>
struct mb_impl<Kokkos::CudaSpace> {
static constexpr int value = 2;
};
#endif
#if defined(KOKKOS_ENABLE_HIP)
template <>
struct mb_impl<Kokkos::Experimental::HIPSpace> {
static constexpr int value = 2;
};
#endif
#if defined(KOKKOS_ENABLE_SYCL)
template <>
struct mb_impl<Kokkos::Experimental::SYCLDeviceUSMSpace> {
static constexpr int value = 2;
};
#endif
#endif
};
struct MKL {
Expand Down Expand Up @@ -398,34 +428,10 @@ struct Algo {

#else // FIXME remove when requiring minimum version of Kokkos 3.6
static constexpr KOKKOS_FUNCTION int mb() {
return mb_impl<Kokkos::Impl::ActiveExecutionMemorySpace>::value;
return algo_level2_blocked_mb_impl<
Kokkos::Impl::ActiveExecutionMemorySpace>::value;
}

private:
template <class>
struct mb_impl;
template <>
struct mb_impl<Kokkos::HostSpace> {
static constexpr int value = 4;
};
#if defined(KOKKOS_ENABLE_CUDA)
template <>
struct mb_impl<Kokkos::CudaSpace> {
static constexpr int value = 1;
};
#endif
#if defined(KOKKOS_ENABLE_HIP)
template <>
struct mb_impl<Kokkos::Experimental::HIPSpace> {
static constexpr int value = 1;
};
#endif
#if defined(KOKKOS_ENABLE_SYCL)
template <>
struct mb_impl<Kokkos::Experimental::SYCLDeviceUSMSpace> {
static constexpr int value = 1;
};
#endif
#endif
};
struct MKL {};
Expand Down

0 comments on commit 8333dfa

Please sign in to comment.