| 35 | } |
| 36 | |
| 37 | void Finalize () |
| 38 | { |
| 39 | if (s_initialized == 1) |
| 40 | { |
| 41 | Clear(); |
| 42 | |
| 43 | #if defined(AMREX_USE_HIP) && defined(AMREX_USE_FFT) |
| 44 | AMREX_ROCFFT_SAFE_CALL(rocfft_cleanup()); |
| 45 | #endif |
| 46 | // We are not calling fftw[f]_cleanup_threads and fftw_cleanup here |
| 47 | // to deallocate a small amount of persist data used by FFTW. This |
| 48 | // can be regarded as a benign memory "leak". Trying to clean up |
| 49 | // fftw data here sometimes causes memory issues when application |
| 50 | // codes still have ffftw plans to be destroyed. |
| 51 | } |
| 52 | |
| 53 | if (s_initialized > 0) { --s_initialized; } |
| 54 | } |
| 55 | |
| 56 | void Clear () |
| 57 | { |
no test coverage detected