Skip to content

Commit

Permalink
unuse static functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Yuuichi Asahi committed Jan 13, 2025
1 parent e9b3d8e commit f92deb5
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 22 deletions.
8 changes: 4 additions & 4 deletions fft/src/KokkosFFT_Cuda_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 6 additions & 6 deletions fft/src/KokkosFFT_FFTW_Types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions fft/src/KokkosFFT_HIP_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 4 additions & 4 deletions fft/src/KokkosFFT_ROCM_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
8 changes: 4 additions & 4 deletions fft/src/KokkosFFT_SYCL_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit f92deb5

Please sign in to comment.