Skip to content

Commit

Permalink
suppress unused arguments and variables in plan create
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Jul 4, 2024
1 parent 3bdd5d0 commit 6bc329b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 45 deletions.
24 changes: 8 additions & 16 deletions fft/src/KokkosFFT_Cuda_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::is_same_v<ExecutionSpace, Kokkos::Cuda>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<1> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<1> axes,
shape_type<1> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down Expand Up @@ -57,10 +55,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::is_same_v<ExecutionSpace, Kokkos::Cuda>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<2> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<2> axes,
shape_type<2> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down Expand Up @@ -96,10 +92,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::is_same_v<ExecutionSpace, Kokkos::Cuda>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<3> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<3> axes,
shape_type<3> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down Expand Up @@ -137,10 +131,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::enable_if_t<std::is_same_v<ExecutionSpace, Kokkos::Cuda>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<fft_rank> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<fft_rank> axes,
shape_type<fft_rank> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down
24 changes: 8 additions & 16 deletions fft/src/KokkosFFT_HIP_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::is_same_v<ExecutionSpace, Kokkos::HIP>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<1> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<1> axes,
shape_type<1> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down Expand Up @@ -59,10 +57,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::is_same_v<ExecutionSpace, Kokkos::HIP>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<2> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<2> axes,
shape_type<2> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down Expand Up @@ -100,10 +96,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::is_same_v<ExecutionSpace, Kokkos::HIP>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<3> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<3> axes,
shape_type<3> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down Expand Up @@ -143,10 +137,8 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::enable_if_t<std::is_same_v<ExecutionSpace, Kokkos::HIP>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<fft_rank> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<fft_rank> axes,
shape_type<fft_rank> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down
8 changes: 3 additions & 5 deletions fft/src/KokkosFFT_OpenMP_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
std::is_same_v<ExecutionSpace, Kokkos::DefaultHostExecutionSpace>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<fft_rank> axes,
shape_type<fft_rank> s) {
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, [[maybe_unused]] Direction direction,
axis_type<fft_rank> axes, shape_type<fft_rank> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
static_assert(Kokkos::is_view<InViewType>::value,
Expand Down
2 changes: 1 addition & 1 deletion fft/src/KokkosFFT_ROCM_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ template <typename ExecutionSpace, typename PlanType, typename InViewType,
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
BufferViewType& buffer, InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<fft_rank> axes,
Direction direction, axis_type<fft_rank> axes,
shape_type<fft_rank> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand Down
9 changes: 2 additions & 7 deletions fft/src/KokkosFFT_SYCL_plans.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,8 @@ template <
std::enable_if_t<std::is_same_v<ExecutionSpace, Kokkos::Experimental::SYCL>,
std::nullptr_t> = nullptr>
auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
const InViewType& in, const OutViewType& out,
[[maybe_unused]] BufferViewType& buffer,
[[maybe_unused]] InfoType& execution_info,
[[maybe_unused]] Direction direction, axis_type<fft_rank> axes,
const InViewType& in, const OutViewType& out, BufferViewType&,
InfoType&, Direction /*direction*/, axis_type<fft_rank> axes,
shape_type<fft_rank> s) {
static_assert(Kokkos::is_view<InViewType>::value,
"KokkosFFT::_create: InViewType is not a Kokkos::View.");
Expand All @@ -77,9 +75,6 @@ auto _create(const ExecutionSpace& exec_space, std::unique_ptr<PlanType>& plan,
int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1,
std::multiplies<>());

// For the moment, considering the contiguous layout only
auto sign = KokkosFFT::Impl::direction_type<ExecutionSpace>(direction);

// Create plan
auto in_strides = compute_strides<int, std::int64_t>(in_extents);
auto out_strides = compute_strides<int, std::int64_t>(out_extents);
Expand Down

0 comments on commit 6bc329b

Please sign in to comment.