Skip to content

Commit

Permalink
Use SpaceAccessibility to check if execution space is a Host space
Browse files Browse the repository at this point in the history
  • Loading branch information
yasahi-hpc committed Aug 27, 2024
1 parent c64d358 commit 6b05084
Showing 1 changed file with 3 additions and 12 deletions.
15 changes: 3 additions & 12 deletions common/src/KokkosFFT_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,21 +263,12 @@ struct complex_view_type {

template <typename ExecutionSpace, typename Enable = void>
struct is_AnyHostSpace : std::false_type {};
#if defined(KOKKOS_ENABLE_SERIAL)
template <typename ExecutionSpace>
struct is_AnyHostSpace<
ExecutionSpace,
std::enable_if_t<
std::is_same_v<ExecutionSpace, Kokkos::Serial> ||
std::is_same_v<ExecutionSpace, Kokkos::DefaultHostExecutionSpace>>>
: std::true_type {};
#else

template <typename ExecutionSpace>
struct is_AnyHostSpace<ExecutionSpace,
std::enable_if_t<std::is_same_v<
ExecutionSpace, Kokkos::DefaultHostExecutionSpace>>>
std::enable_if_t<Kokkos::SpaceAccessibility<
ExecutionSpace, Kokkos::HostSpace>::accessible>>
: std::true_type {};
#endif

/// \brief Helper to check if the ExecutionSpace is one of the enabled
/// HostExecutionSpaces
Expand Down

0 comments on commit 6b05084

Please sign in to comment.