Skip to content

Commit cde6325

Browse files
committed
Add rocfft setup and cleanup
1 parent b9bbb33 commit cde6325

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

Src/Base/AMReX_GpuDevice.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,13 @@
3535
#include <roctracer/roctx.h>
3636
#endif
3737
#endif
38+
#if defined(AMREX_USE_FFT)
39+
# if __has_include(<rocfft/rocfft.h>) // ROCm 5.3+
40+
# include <rocfft/rocfft.h>
41+
# else
42+
# include <rocfft.h>
43+
# endif
44+
#endif
3845
#endif
3946

4047
#ifdef AMREX_USE_ACC
@@ -310,6 +317,10 @@ Device::Initialize ()
310317
}
311318
#endif /* AMREX_USE_MPI */
312319

320+
#if defined(AMREX_USE_HIP) && defined(AMREX_USE_FFT)
321+
AMREX_ROCFFT_SAFE_CALL(rocfft_setup());
322+
#endif
323+
313324
if (amrex::Verbose()) {
314325
#if defined(AMREX_USE_CUDA)
315326
amrex::Print() << "CUDA"
@@ -349,6 +360,10 @@ Device::Finalize ()
349360
#ifdef AMREX_USE_GPU
350361
Device::profilerStop();
351362

363+
#if defined(AMREX_USE_HIP) && defined(AMREX_USE_FFT)
364+
AMREX_ROCFFT_SAFE_CALL(rocfft_cleanup());
365+
#endif
366+
352367
#ifdef AMREX_USE_SYCL
353368
for (auto& s : gpu_stream_pool) {
354369
delete s.queue;

0 commit comments

Comments
 (0)