From badfefbf29d9daf9134f130bc41a08aa4b3394cf Mon Sep 17 00:00:00 2001 From: yasahi-hpc <57478230+yasahi-hpc@users.noreply.github.com> Date: Thu, 4 Jul 2024 12:09:21 +0200 Subject: [PATCH] Cleaning up some warnings and enabling -Werror on NVIDIA GPU CI tests (#111) * Cleaning up some warnings with nvcc * Enable -Werror for CUDA backend * format * Add maybe_unused for fftw backend * fix: compile options should be set for Kokkos-fft not Kokkos --------- Co-authored-by: Yuuichi Asahi --- .github/workflows/build_test.yaml | 2 +- common/src/KokkosFFT_transpose.hpp | 4 ++-- fft/src/KokkosFFT_Cuda_plans.hpp | 4 +++- fft/src/KokkosFFT_OpenMP_plans.hpp | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/build_test.yaml b/.github/workflows/build_test.yaml index 74b94bda..ed252965 100644 --- a/.github/workflows/build_test.yaml +++ b/.github/workflows/build_test.yaml @@ -97,7 +97,7 @@ jobs: cxx: g++ cmake_flags: kokkos: -DKokkos_ENABLE_CUDA=ON -DKokkos_ARCH_AMPERE80=ON - kokkos_fft: "" + kokkos_fft: -DCMAKE_CXX_FLAGS="-Wall -Wextra -Werror" - name: hip image: rocm compiler: diff --git a/common/src/KokkosFFT_transpose.hpp b/common/src/KokkosFFT_transpose.hpp index 56e8476b..a9b3b864 100644 --- a/common/src/KokkosFFT_transpose.hpp +++ b/common/src/KokkosFFT_transpose.hpp @@ -73,8 +73,8 @@ auto get_map_axes(const ViewType& view, axis_type _axes) { map_inv.push_back(get_index(map, i)); } - using full_axis_type = axis_type; - full_axis_type array_map, array_map_inv; + using full_axis_type = axis_type; + full_axis_type array_map = {0}, array_map_inv = {0}; std::copy(map.begin(), map.end(), array_map.begin()); std::copy(map_inv.begin(), map_inv.end(), array_map_inv.begin()); diff --git a/fft/src/KokkosFFT_Cuda_plans.hpp b/fft/src/KokkosFFT_Cuda_plans.hpp index cd08e759..816c797e 100644 --- a/fft/src/KokkosFFT_Cuda_plans.hpp +++ b/fft/src/KokkosFFT_Cuda_plans.hpp @@ -194,7 +194,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 50464c83..0b3f9883 100644 --- a/fft/src/KokkosFFT_OpenMP_plans.hpp +++ b/fft/src/KokkosFFT_OpenMP_plans.hpp @@ -73,7 +73,8 @@ auto _create(const ExecutionSpace& exec_space, std::unique_ptr& plan, // For the moment, considering the contiguous layout only int istride = 1, ostride = 1; - auto sign = KokkosFFT::Impl::direction_type(direction); + [[maybe_unused]] auto sign = + KokkosFFT::Impl::direction_type(direction); plan = std::make_unique(); if constexpr (type == KokkosFFT::Impl::FFTWTransformType::R2C) {