aboutsummaryrefslogtreecommitdiff
path: root/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
diff options
context:
space:
mode:
authorGravatar MaxThevenet <mthevenet@lbl.gov> 2020-02-24 15:54:50 -0800
committerGravatar GitHub <noreply@github.com> 2020-02-24 15:54:50 -0800
commitbbefc3dad687f4370afd5bc85386d983201cb321 (patch)
treedbbff865cd72e16b87046685dfc25835f1d2573c /Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
parent8c3523a1054a0d7591cac951aa723f2b01c8e68d (diff)
downloadWarpX-bbefc3dad687f4370afd5bc85386d983201cb321.tar.gz
WarpX-bbefc3dad687f4370afd5bc85386d983201cb321.tar.zst
WarpX-bbefc3dad687f4370afd5bc85386d983201cb321.zip
Profiler wrapper to allow for cudaDeviceSynchronize (#738)
* add warpx profiler wrapper * call WX profiler wrapper instead of BL * EOL and cleaning * add doc on profile syncs * do not use PROFILE macros in .H files * replace WX_PROFILE with WARPX_PROFILE and use bool instead of int * typo * this file shouldn't be there
Diffstat (limited to 'Source/FieldSolver/SpectralSolver/SpectralSolver.cpp')
-rw-r--r--Source/FieldSolver/SpectralSolver/SpectralSolver.cpp32
1 files changed, 30 insertions, 2 deletions
diff --git a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
index c24a7af69..9df981528 100644
--- a/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
+++ b/Source/FieldSolver/SpectralSolver/SpectralSolver.cpp
@@ -9,7 +9,8 @@
#include <PsatdAlgorithm.H>
#include <GalileanAlgorithm.H>
#include <PMLPsatdAlgorithm.H>
-
+#include "WarpX.H"
+#include "WarpXProfilerWrapper.H"
/* \brief Initialize the spectral Maxwell solver
*
@@ -62,4 +63,31 @@ SpectralSolver::SpectralSolver(
field_data = SpectralFieldData( realspace_ba, k_space, dm,
algorithm->getRequiredNumberOfFields() );
-};
+}
+
+void
+SpectralSolver::ForwardTransform( const amrex::MultiFab& mf,
+ const int field_index,
+ const int i_comp )
+{
+ WARPX_PROFILE("SpectralSolver::ForwardTransform");
+ field_data.ForwardTransform( mf, field_index, i_comp );
+}
+
+void
+SpectralSolver::BackwardTransform( amrex::MultiFab& mf,
+ const int field_index,
+ const int i_comp )
+{
+ WARPX_PROFILE("SpectralSolver::BackwardTransform");
+ field_data.BackwardTransform( mf, field_index, i_comp );
+}
+
+void
+SpectralSolver::pushSpectralFields(){
+ WARPX_PROFILE("SpectralSolver::pushSpectralFields");
+ // Virtual function: the actual function used here depends
+ // on the sub-class of `SpectralBaseAlgorithm` that was
+ // initialized in the constructor of `SpectralSolver`
+ algorithm->pushSpectralFields( field_data );
+}