From a455df61ad2df6fda6e0a27d736776c7ddffc8be Mon Sep 17 00:00:00 2001 From: Luca Fedeli Date: Fri, 24 Mar 2023 23:42:45 +0100 Subject: Refactoring of main.cpp to improve readability (#3784) * refactoring of main.cpp to improve readability * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * fixed bug --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- Source/Utils/WarpXrocfftUtil.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Source/Utils/WarpXrocfftUtil.cpp (limited to 'Source/Utils/WarpXrocfftUtil.cpp') diff --git a/Source/Utils/WarpXrocfftUtil.cpp b/Source/Utils/WarpXrocfftUtil.cpp new file mode 100644 index 000000000..8af65f1b6 --- /dev/null +++ b/Source/Utils/WarpXrocfftUtil.cpp @@ -0,0 +1,33 @@ +/* Copyright 2023 Luca Fedeli + * + * This file is part of WarpX. + * + * License: BSD-3-Clause-LBNL + */ + +#include "WarpXrocfftUtil.H" + +#include + +#if defined(AMREX_USE_HIP) && defined(WARPX_USE_PSATD) +// cstddef: work-around for ROCm/rocFFT <=4.3.0 +// https://github.com/ROCmSoftwarePlatform/rocFFT/blob/rocm-4.3.0/library/include/rocfft.h#L36-L42 +# include +# include +#endif + +void +utils::rocfft::setup() +{ +#if defined(AMREX_USE_HIP) && defined(WARPX_USE_PSATD) + rocfft_setup(); +#endif +} + +void +utils::rocfft::cleanup() +{ +#if defined(AMREX_USE_HIP) && defined(WARPX_USE_PSATD) + rocfft_cleanup(); +#endif +} -- cgit v1.2.3