From f92deb500d7341139a77dec6593de15ba0245bb2 Mon Sep 17 00:00:00 2001 From: Yuuichi Asahi Date: Mon, 13 Jan 2025 17:10:36 +0900 Subject: [PATCH] unuse static functions --- fft/src/KokkosFFT_Cuda_types.hpp | 8 ++++---- fft/src/KokkosFFT_FFTW_Types.hpp | 12 ++++++------ fft/src/KokkosFFT_HIP_types.hpp | 8 ++++---- fft/src/KokkosFFT_ROCM_types.hpp | 8 ++++---- fft/src/KokkosFFT_SYCL_types.hpp | 8 ++++---- 5 files changed, 22 insertions(+), 22 deletions(-) diff --git a/fft/src/KokkosFFT_Cuda_types.hpp b/fft/src/KokkosFFT_Cuda_types.hpp index ac1d7cbd..bf6eef20 100644 --- a/fft/src/KokkosFFT_Cuda_types.hpp +++ b/fft/src/KokkosFFT_Cuda_types.hpp @@ -239,12 +239,12 @@ auto direction_type(Direction direction) { return direction == Direction::forward ? CUFFT_FORWARD : CUFFT_INVERSE; } -static void initialize_host() {} -static void finalize_host() {} +inline void initialize_host() {} +inline void finalize_host() {} #endif -static void initialize_device() {} -static void finalize_device() {} +inline void initialize_device() {} +inline void finalize_device() {} } // namespace Impl } // namespace KokkosFFT diff --git a/fft/src/KokkosFFT_FFTW_Types.hpp b/fft/src/KokkosFFT_FFTW_Types.hpp index b22efa91..0243aefc 100644 --- a/fft/src/KokkosFFT_FFTW_Types.hpp +++ b/fft/src/KokkosFFT_FFTW_Types.hpp @@ -139,25 +139,25 @@ struct ScopedFFTWPlan { }; #if defined(KOKKOS_ENABLE_OPENMP) || defined(KOKKOS_ENABLE_THREADS) -static void initialize_host() { +inline void initialize_host() { fftwf_init_threads(); fftw_init_threads(); } -static void finalize_host() { +inline void finalize_host() { fftwf_cleanup_threads(); fftw_cleanup_threads(); } #else -static void initialize_host() {} -static void finalize_host() {} +inline void initialize_host() {} +inline void finalize_host() {} #endif // If non of device backend is enabled, then FFTW is responsible // for the device cleanup. Otherwise, device backend will cleanup #if !(defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) || \ defined(KOKKOS_ENABLE_SYCL)) -static void initialize_device() {} -static void finalize_device() {} +inline void initialize_device() {} +inline void finalize_device() {} #endif } // namespace Impl diff --git a/fft/src/KokkosFFT_HIP_types.hpp b/fft/src/KokkosFFT_HIP_types.hpp index 4a61b26b..d371e159 100644 --- a/fft/src/KokkosFFT_HIP_types.hpp +++ b/fft/src/KokkosFFT_HIP_types.hpp @@ -239,12 +239,12 @@ auto direction_type(Direction direction) { return direction == Direction::forward ? HIPFFT_FORWARD : HIPFFT_BACKWARD; } -static void initialize_host() {} -static void finalize_host() {} +inline void initialize_host() {} +inline void finalize_host() {} #endif -static void initialize_device() {} -static void finalize_device() {} +inline void initialize_device() {} +inline void finalize_device() {} } // namespace Impl } // namespace KokkosFFT diff --git a/fft/src/KokkosFFT_ROCM_types.hpp b/fft/src/KokkosFFT_ROCM_types.hpp index e08053dd..d2c25217 100644 --- a/fft/src/KokkosFFT_ROCM_types.hpp +++ b/fft/src/KokkosFFT_ROCM_types.hpp @@ -364,15 +364,15 @@ auto direction_type(Direction direction) { return direction == Direction::forward ? ROCFFT_FORWARD : ROCFFT_BACKWARD; } -static void initialize_host() {} -static void finalize_host() {} +inline void initialize_host() {} +inline void finalize_host() {} #endif -static void initialize_device() { +inline void initialize_device() { rocfft_status status = rocfft_setup(); if (status != rocfft_status_success) Kokkos::abort("rocfft_setup failed"); } -static void finalize_device() { +inline void finalize_device() { rocfft_status status = rocfft_cleanup(); if (status != rocfft_status_success) Kokkos::abort("rocfft_cleanup failed"); } diff --git a/fft/src/KokkosFFT_SYCL_types.hpp b/fft/src/KokkosFFT_SYCL_types.hpp index db4b2442..285574c8 100644 --- a/fft/src/KokkosFFT_SYCL_types.hpp +++ b/fft/src/KokkosFFT_SYCL_types.hpp @@ -226,12 +226,12 @@ auto direction_type(Direction direction) { return direction == Direction::forward ? MKL_FFT_FORWARD : MKL_FFT_BACKWARD; } -static void initialize_host() {} -static void finalize_host() {} +inline void initialize_host() {} +inline void finalize_host() {} #endif -static void initialize_device() {} -static void finalize_device() {} +inline void initialize_device() {} +inline void finalize_device() {} } // namespace Impl } // namespace KokkosFFT