diff --git a/fft/src/KokkosFFT_Host_plans.hpp b/fft/src/KokkosFFT_Host_plans.hpp index 404a2546..44070993 100644 --- a/fft/src/KokkosFFT_Host_plans.hpp +++ b/fft/src/KokkosFFT_Host_plans.hpp @@ -32,9 +32,8 @@ void init_threads([[maybe_unused]] const ExecutionSpace& exec_space) { template , - std::nullptr_t> = nullptr> + std::enable_if_t, std::nullptr_t> = + nullptr> auto create_plan(const ExecutionSpace& exec_space, std::unique_ptr& plan, const InViewType& in, const OutViewType& out, BufferViewType&, InfoType&, @@ -109,9 +108,8 @@ auto create_plan(const ExecutionSpace& exec_space, } template , - std::nullptr_t> = nullptr> + std::enable_if_t, std::nullptr_t> = + nullptr> void destroy_plan_and_info(std::unique_ptr& plan, InfoType&) { if constexpr (std::is_same_v) { fftwf_destroy_plan(*plan); diff --git a/fft/src/KokkosFFT_Plans.hpp b/fft/src/KokkosFFT_Plans.hpp index 925eccea..36bb2681 100644 --- a/fft/src/KokkosFFT_Plans.hpp +++ b/fft/src/KokkosFFT_Plans.hpp @@ -155,10 +155,11 @@ class Plan { /// \param axis [in] Axis over which FFT is performed /// \param n [in] Length of the transformed axis of the output (optional) // - explicit Plan(const ExecutionSpace& exec_space, InViewType& in, - OutViewType& out, KokkosFFT::Direction direction, int axis, - std::optional n = std::nullopt, - std::enable_if_t, std::nullptr_t> = nullptr) + explicit Plan( + const ExecutionSpace& exec_space, InViewType& in, OutViewType& out, + KokkosFFT::Direction direction, int axis, + std::optional n = std::nullopt, + std::enable_if_t, std::nullptr_t> = nullptr) : m_exec_space(exec_space), m_axes({axis}), m_direction(direction) { static_assert( KokkosFFT::Impl::are_operatable_views_v axes, shape_type s = {0}, - std::enable_if_t, std::nullptr_t> = nullptr) + explicit Plan( + const ExecutionSpace& exec_space, InViewType& in, OutViewType& out, + KokkosFFT::Direction direction, axis_type axes, + shape_type s = {0}, + std::enable_if_t, std::nullptr_t> = nullptr) : m_exec_space(exec_space), m_axes(axes), m_direction(direction) { static_assert( KokkosFFT::Impl::are_operatable_views_v, std::pair >; #if defined(KOKKOS_ENABLE_SERIAL) -using execution_spaces = ::testing::Types; +using execution_spaces = + ::testing::Types; #else using execution_spaces = ::testing::Types; @@ -59,24 +59,35 @@ TYPED_TEST_SUITE(Plans3D, test_types); // Tests for execution space template void test_plan_constructible() { - using ValueType = double; + using ValueType = double; using RealView1DType = Kokkos::View; using ComplexView1DType = Kokkos::View*, ExecutionSpace>; - using PlanType = KokkosFFT::Impl::Plan; - - #if !defined(ENABLE_HOST_AND_DEVICE) && (defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) || defined(KOKKOS_ENABLE_SYCL)) - // For GPUs without ENABLE_HOST_AND_DEVICE, a plan can be constructible from Kokkos::DefaultExecutionSpace only - if constexpr (std::is_same_v) { - static_assert(std::is_constructible_v); - } else { - static_assert(!std::is_constructible_v); - } - #else - // For CPUs or GPUs with ENABLE_HOST_AND_DEVICE, - // a plan can be constructible from Kokkos::DefaultExecutionSpace, Kokkos::DefaultHostExecutionSpace or Kokkos::Serial (if enabled) - static_assert(std::is_constructible_v); - #endif + using PlanType = + KokkosFFT::Impl::Plan; + +#if !defined(ENABLE_HOST_AND_DEVICE) && \ + (defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) || \ + defined(KOKKOS_ENABLE_SYCL)) + // For GPUs without ENABLE_HOST_AND_DEVICE, a plan can be constructible from + // Kokkos::DefaultExecutionSpace only + if constexpr (std::is_same_v) { + static_assert(std::is_constructible_v); + } else { + static_assert(!std::is_constructible_v); + } +#else + // For CPUs or GPUs with ENABLE_HOST_AND_DEVICE, + // a plan can be constructible from Kokkos::DefaultExecutionSpace, + // Kokkos::DefaultHostExecutionSpace or Kokkos::Serial (if enabled) + static_assert( + std::is_constructible_v); +#endif } // Tests for 1D FFT plan on 1D View