Skip to content

Commit

Permalink
Cleaning up some warnings and enabling -Werror on Intel GPU CI tests (#…
Browse files Browse the repository at this point in the history
…112)

* suppress unused arguments

* Add -Werror option in icpx CI

* suppress unused arguments and variables in plan create

* Allow some warning for intel GPU CI

* fix: missing & in _destroy_info for SYCL

* remove unused variable from SYCL plan

---------

Co-authored-by: Yuuichi Asahi <[email protected]>
  • Loading branch information
yasahi-hpc and Yuuichi Asahi authored Jul 5, 2024
1 parent badfefb commit 04c180e
Show file tree
Hide file tree
Showing 10 changed files with 53 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ jobs:
# building for Intel PVC was unsuccessful without the proper
# device, so for now, we simply generate generic Intel GPU code
kokkos: -DKokkos_ENABLE_SYCL=ON -DKokkos_ARCH_INTEL_GEN=ON
kokkos_fft: ""
kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra"
target:
- name: native
cmake_flags: ""
Expand Down
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
17 changes: 6 additions & 11 deletions fft/src/KokkosFFT_Cuda_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,52 +11,47 @@ namespace KokkosFFT {
namespace Impl {
template <typename... Args>
inline void _exec(cufftHandle& plan, cufftReal* idata, cufftComplex* odata,
[[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
cufftResult cufft_rt = cufftExecR2C(plan, idata, odata);
if (cufft_rt != CUFFT_SUCCESS)
throw std::runtime_error("cufftExecR2C failed");
}

template <typename... Args>
inline void _exec(cufftHandle& plan, cufftDoubleReal* idata,
cufftDoubleComplex* odata, [[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
cufftDoubleComplex* odata, int /*direction*/, Args...) {
cufftResult cufft_rt = cufftExecD2Z(plan, idata, odata);
if (cufft_rt != CUFFT_SUCCESS)
throw std::runtime_error("cufftExecD2Z failed");
}

template <typename... Args>
inline void _exec(cufftHandle& plan, cufftComplex* idata, cufftReal* odata,
[[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
cufftResult cufft_rt = cufftExecC2R(plan, idata, odata);
if (cufft_rt != CUFFT_SUCCESS)
throw std::runtime_error("cufftExecC2R failed");
}

template <typename... Args>
inline void _exec(cufftHandle& plan, cufftDoubleComplex* idata,
cufftDoubleReal* odata, [[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
cufftDoubleReal* odata, int /*direction*/, Args...) {
cufftResult cufft_rt = cufftExecZ2D(plan, idata, odata);
if (cufft_rt != CUFFT_SUCCESS)
throw std::runtime_error("cufftExecZ2D failed");
}

template <typename... Args>
inline void _exec(cufftHandle& plan, cufftComplex* idata, cufftComplex* odata,
int direction, [[maybe_unused]] Args... args) {
int direction, Args...) {
cufftResult cufft_rt = cufftExecC2C(plan, idata, odata, direction);
if (cufft_rt != CUFFT_SUCCESS)
throw std::runtime_error("cufftExecC2C failed");
}

template <typename... Args>
inline void _exec(cufftHandle& plan, cufftDoubleComplex* idata,
cufftDoubleComplex* odata, int direction,
[[maybe_unused]] Args... args) {
cufftDoubleComplex* odata, int direction, Args...) {
cufftResult cufft_rt = cufftExecZ2Z(plan, idata, odata, direction);
if (cufft_rt != CUFFT_SUCCESS)
throw std::runtime_error("cufftExecZ2Z failed");
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
18 changes: 6 additions & 12 deletions fft/src/KokkosFFT_HIP_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,53 +11,47 @@ namespace KokkosFFT {
namespace Impl {
template <typename... Args>
inline void _exec(hipfftHandle& plan, hipfftReal* idata, hipfftComplex* odata,
[[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
hipfftResult hipfft_rt = hipfftExecR2C(plan, idata, odata);
if (hipfft_rt != HIPFFT_SUCCESS)
throw std::runtime_error("hipfftExecR2C failed");
}

template <typename... Args>
inline void _exec(hipfftHandle& plan, hipfftDoubleReal* idata,
hipfftDoubleComplex* odata, [[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
hipfftDoubleComplex* odata, int /*direction*/, Args...) {
hipfftResult hipfft_rt = hipfftExecD2Z(plan, idata, odata);
if (hipfft_rt != HIPFFT_SUCCESS)
throw std::runtime_error("hipfftExecD2Z failed");
}

template <typename... Args>
inline void _exec(hipfftHandle& plan, hipfftComplex* idata, hipfftReal* odata,
[[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
hipfftResult hipfft_rt = hipfftExecC2R(plan, idata, odata);
if (hipfft_rt != HIPFFT_SUCCESS)
throw std::runtime_error("hipfftExecC2R failed");
}

template <typename... Args>
inline void _exec(hipfftHandle& plan, hipfftDoubleComplex* idata,
hipfftDoubleReal* odata, [[maybe_unused]] int direction,
[[maybe_unused]] Args... args) {
hipfftDoubleReal* odata, int /*direction*/, Args...) {
hipfftResult hipfft_rt = hipfftExecZ2D(plan, idata, odata);
if (hipfft_rt != HIPFFT_SUCCESS)
throw std::runtime_error("hipfftExecZ2D failed");
}

template <typename... Args>
inline void _exec(hipfftHandle& plan, hipfftComplex* idata,
hipfftComplex* odata, int direction,
[[maybe_unused]] Args... args) {
hipfftComplex* odata, int direction, Args...) {
hipfftResult hipfft_rt = hipfftExecC2C(plan, idata, odata, direction);
if (hipfft_rt != HIPFFT_SUCCESS)
throw std::runtime_error("hipfftExecC2C failed");
}

template <typename... Args>
inline void _exec(hipfftHandle& plan, hipfftDoubleComplex* idata,
hipfftDoubleComplex* odata, int direction,
[[maybe_unused]] Args... args) {
hipfftDoubleComplex* odata, int direction, Args...) {
hipfftResult hipfft_rt = hipfftExecZ2Z(plan, idata, odata, direction);
if (hipfft_rt != HIPFFT_SUCCESS)
throw std::runtime_error("hipfftExecZ2Z failed");
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
12 changes: 6 additions & 6 deletions fft/src/KokkosFFT_OpenMP_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,37 @@ namespace KokkosFFT {
namespace Impl {
template <typename PlanType, typename... Args>
void _exec(PlanType& plan, float* idata, fftwf_complex* odata,
[[maybe_unused]] int direction, [[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
fftwf_execute_dft_r2c(plan, idata, odata);
}

template <typename PlanType, typename... Args>
void _exec(PlanType& plan, double* idata, fftw_complex* odata,
[[maybe_unused]] int direction, [[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
fftw_execute_dft_r2c(plan, idata, odata);
}

template <typename PlanType, typename... Args>
void _exec(PlanType& plan, fftwf_complex* idata, float* odata,
[[maybe_unused]] int direction, [[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
fftwf_execute_dft_c2r(plan, idata, odata);
}

template <typename PlanType, typename... Args>
void _exec(PlanType& plan, fftw_complex* idata, double* odata,
[[maybe_unused]] int direction, [[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
fftw_execute_dft_c2r(plan, idata, odata);
}

template <typename PlanType, typename... Args>
void _exec(PlanType& plan, fftwf_complex* idata, fftwf_complex* odata,
[[maybe_unused]] int direction, [[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
fftwf_execute_dft(plan, idata, odata);
}

template <typename PlanType, typename... Args>
void _exec(PlanType plan, fftw_complex* idata, fftw_complex* odata,
[[maybe_unused]] int direction, [[maybe_unused]] Args... args) {
int /*direction*/, Args...) {
fftw_execute_dft(plan, idata, odata);
}
} // namespace Impl
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
12 changes: 6 additions & 6 deletions fft/src/KokkosFFT_ROCM_transform.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
namespace KokkosFFT {
namespace Impl {
inline void _exec(rocfft_plan& plan, float* idata, std::complex<float>* odata,
[[maybe_unused]] int direction,
int /*direction*/,
const rocfft_execution_info& execution_info) {
rocfft_status status =
rocfft_execute(plan, (void**)&idata, (void**)&odata, execution_info);
Expand All @@ -20,7 +20,7 @@ inline void _exec(rocfft_plan& plan, float* idata, std::complex<float>* odata,
}

inline void _exec(rocfft_plan& plan, double* idata, std::complex<double>* odata,
[[maybe_unused]] int direction,
int /*direction*/,
const rocfft_execution_info& execution_info) {
rocfft_status status =
rocfft_execute(plan, (void**)&idata, (void**)&odata, execution_info);
Expand All @@ -29,7 +29,7 @@ inline void _exec(rocfft_plan& plan, double* idata, std::complex<double>* odata,
}

inline void _exec(rocfft_plan& plan, std::complex<float>* idata, float* odata,
[[maybe_unused]] int direction,
int /*direction*/,
const rocfft_execution_info& execution_info) {
rocfft_status status =
rocfft_execute(plan, (void**)&idata, (void**)&odata, execution_info);
Expand All @@ -38,7 +38,7 @@ inline void _exec(rocfft_plan& plan, std::complex<float>* idata, float* odata,
}

inline void _exec(rocfft_plan& plan, std::complex<double>* idata, double* odata,
[[maybe_unused]] int direction,
int /*direction*/,
const rocfft_execution_info& execution_info) {
rocfft_status status =
rocfft_execute(plan, (void**)&idata, (void**)&odata, execution_info);
Expand All @@ -47,7 +47,7 @@ inline void _exec(rocfft_plan& plan, std::complex<double>* idata, double* odata,
}

inline void _exec(rocfft_plan& plan, std::complex<float>* idata,
std::complex<float>* odata, [[maybe_unused]] int direction,
std::complex<float>* odata, int /*direction*/,
const rocfft_execution_info& execution_info) {
rocfft_status status =
rocfft_execute(plan, (void**)&idata, (void**)&odata, execution_info);
Expand All @@ -56,7 +56,7 @@ inline void _exec(rocfft_plan& plan, std::complex<float>* idata,
}

inline void _exec(rocfft_plan& plan, std::complex<double>* idata,
std::complex<double>* odata, [[maybe_unused]] int direction,
std::complex<double>* odata, int /*direction*/,
const rocfft_execution_info& execution_info) {
rocfft_status status =
rocfft_execute(plan, (void**)&idata, (void**)&odata, execution_info);
Expand Down
Loading

0 comments on commit 04c180e

Please sign in to comment.