From e940c4595a53894945bbba9b44105557c0bb94b6 Mon Sep 17 00:00:00 2001 From: yasahi-hpc <57478230+yasahi-hpc@users.noreply.github.com> Date: Wed, 3 Jul 2024 13:01:57 +0200 Subject: [PATCH] Cleaning up some warnings and enabling -Werror on AMD GPU CI tests (#109) * remove unused lines for HIP backend * Add warnings on HIP CI * Add Werror option in hip CI * Add maybe_unused for fftw backend --------- Co-authored-by: Yuuichi Asahi --- .github/workflows/build_test.yaml | 4 ++-- fft/src/KokkosFFT_HIP_plans.hpp | 4 +++- fft/src/KokkosFFT_OpenMP_plans.hpp | 2 +- fft/src/KokkosFFT_ROCM_plans.hpp | 7 ------- 4 files changed, 6 insertions(+), 11 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 841f7acb..74b94bda 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -105,7 +105,7 @@ jobs: cxx: hipcc cmake_flags: kokkos: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON - kokkos_fft: -DKokkosFFT_ENABLE_ROCFFT=ON + kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" -DKokkosFFT_ENABLE_ROCFFT=ON - name: rocm image: rocm compiler: @@ -113,7 +113,7 @@ jobs: cxx: hipcc cmake_flags: kokkos: -DKokkos_ENABLE_HIP=ON -DKokkos_ARCH_VEGA90A=ON - kokkos_fft: "" + kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" - name: sycl image: intel compiler: diff --git a/fft/src/KokkosFFT_HIP_plans.hpp b/fft/src/KokkosFFT_HIP_plans.hpp index 53c79ec2..c20bcba7 100644 --- a/fft/src/KokkosFFT_HIP_plans.hpp +++ b/fft/src/KokkosFFT_HIP_plans.hpp @@ -201,7 +201,9 @@ void _destroy_plan(std::unique_ptr& plan) { template , std::nullptr_t> = nullptr> -void _destroy_info(InfoType& plan) {} +void _destroy_info(InfoType&) { + // not used, no finalization is required +} } // namespace Impl } // namespace KokkosFFT diff --git a/fft/src/KokkosFFT_OpenMP_plans.hpp b/fft/src/KokkosFFT_OpenMP_plans.hpp index fe7d5e5a..50464c83 100644 --- a/fft/src/KokkosFFT_OpenMP_plans.hpp +++ b/fft/src/KokkosFFT_OpenMP_plans.hpp @@ -12,7 +12,7 @@ namespace KokkosFFT { namespace Impl { template -void _init_threads(const ExecutionSpace& exec_space) { +void _init_threads([[maybe_unused]] const ExecutionSpace& exec_space) { #if defined(KOKKOS_ENABLE_OPENMP) || defined(KOKKOS_ENABLE_THREADS) int nthreads = exec_space.concurrency(); diff --git a/fft/src/KokkosFFT_ROCM_plans.hpp b/fft/src/KokkosFFT_ROCM_plans.hpp index 3592c560..c2a2b64f 100644 --- a/fft/src/KokkosFFT_ROCM_plans.hpp +++ b/fft/src/KokkosFFT_ROCM_plans.hpp @@ -100,7 +100,6 @@ auto _create(const ExecutionSpace& exec_space, std::unique_ptr& plan, static_assert( InViewType::rank() >= fft_rank, "KokkosFFT::_create: Rank of View must be larger than Rank of FFT."); - const int rank = fft_rank; constexpr auto type = KokkosFFT::Impl::transform_type& plan, int fft_size = std::accumulate(fft_extents.begin(), fft_extents.end(), 1, std::multiplies<>()); - auto* idata = reinterpret_cast::type*>(in.data()); - auto* odata = reinterpret_cast::type*>(out.data()); - // For the moment, considering the contiguous layout only // Create plan auto in_strides = compute_strides(in_extents); @@ -211,7 +205,6 @@ template