aboutsummaryrefslogtreecommitdiff
path: root/Source/Particles
diff options
context:
space:
mode:
authorGravatar Luca Fedeli <luca.fedeli@cea.fr> 2023-04-21 22:13:21 +0200
committerGravatar GitHub <noreply@github.com> 2023-04-21 13:13:21 -0700
commit7170d1b45c5092c060655ec216e4e56be74b3edb (patch)
treecf02be5c37db95408ab84da2ea70c1ae25d844dc /Source/Particles
parentec6817db0bbdd418babb0002314fdc85e6c48e96 (diff)
downloadWarpX-7170d1b45c5092c060655ec216e4e56be74b3edb.tar.gz
WarpX-7170d1b45c5092c060655ec216e4e56be74b3edb.tar.zst
WarpX-7170d1b45c5092c060655ec216e4e56be74b3edb.zip
Move KernelTimer.H to ablastr/parallelization (#3863)
* move KernelTimer to ablastr * add missing folder * fixed bug * fixed bug * really fixed the bug * kernelTimer -> KernelTimer
Diffstat (limited to 'Source/Particles')
-rw-r--r--Source/Particles/Deposition/ChargeDeposition.H7
-rw-r--r--Source/Particles/Deposition/CurrentDeposition.H17
2 files changed, 14 insertions, 10 deletions
diff --git a/Source/Particles/Deposition/ChargeDeposition.H b/Source/Particles/Deposition/ChargeDeposition.H
index 7f6cccea5..88d952919 100644
--- a/Source/Particles/Deposition/ChargeDeposition.H
+++ b/Source/Particles/Deposition/ChargeDeposition.H
@@ -8,7 +8,7 @@
#ifndef CHARGEDEPOSITION_H_
#define CHARGEDEPOSITION_H_
-#include "Parallelization/KernelTimer.H"
+#include "ablastr/parallelization/KernelTimer.H"
#include "Particles/Pusher/GetAndSetPosition.H"
#include "Particles/ShapeFactors.H"
#include "Utils/WarpXAlgorithmSelection.H"
@@ -98,8 +98,9 @@ void doChargeDepositionShapeN (const GetParticlePosition& GetPosition,
np_to_depose,
[=] AMREX_GPU_DEVICE (long ip) {
#if defined(WARPX_USE_GPUCLOCK)
- KernelTimer kernelTimer(cost && load_balance_costs_update_algo
- == LoadBalanceCostsUpdateAlgo::GpuClock, cost_real);
+ const auto KernelTimer = ablastr::parallelization::KernelTimer(
+ cost && (load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::GpuClock),
+ cost_real);
#endif
// --- Get particle quantities
amrex::Real wq = q*wp[ip]*invvol;
diff --git a/Source/Particles/Deposition/CurrentDeposition.H b/Source/Particles/Deposition/CurrentDeposition.H
index ccc27ca96..8a3aae004 100644
--- a/Source/Particles/Deposition/CurrentDeposition.H
+++ b/Source/Particles/Deposition/CurrentDeposition.H
@@ -8,7 +8,7 @@
#ifndef CURRENTDEPOSITION_H_
#define CURRENTDEPOSITION_H_
-#include "Parallelization/KernelTimer.H"
+#include "ablastr/parallelization/KernelTimer.H"
#include "Particles/Pusher/GetAndSetPosition.H"
#include "Particles/ShapeFactors.H"
#include "Utils/WarpXAlgorithmSelection.H"
@@ -125,8 +125,9 @@ void doDepositionShapeN(const GetParticlePosition& GetPosition,
np_to_depose,
[=] AMREX_GPU_DEVICE (long ip) {
#if defined(WARPX_USE_GPUCLOCK)
- KernelTimer kernelTimer(cost && load_balance_costs_update_algo
- == LoadBalanceCostsUpdateAlgo::GpuClock, cost_real);
+ const auto KernelTimer = ablastr::parallelization::KernelTimer(
+ cost && (load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::GpuClock),
+ cost_real);
#endif
// --- Get particle quantities
@@ -441,8 +442,9 @@ void doEsirkepovDepositionShapeN (const GetParticlePosition& GetPosition,
np_to_depose,
[=] AMREX_GPU_DEVICE (long const ip) {
#if defined(WARPX_USE_GPUCLOCK)
- KernelTimer kernelTimer(cost && load_balance_costs_update_algo
- == LoadBalanceCostsUpdateAlgo::GpuClock, cost_real);
+ const auto KernelTimer = ablastr::parallelization::KernelTimer(
+ cost && (load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::GpuClock),
+ cost_real);
#endif
// --- Get particle quantities
@@ -836,8 +838,9 @@ void doVayDepositionShapeN (const GetParticlePosition& GetPosition,
amrex::ParallelFor(np_to_depose, [=] AMREX_GPU_DEVICE (long ip)
{
#if defined(WARPX_USE_GPUCLOCK)
- KernelTimer kernelTimer(cost && load_balance_costs_update_algo
- == LoadBalanceCostsUpdateAlgo::GpuClock, cost_real);
+ const auto KernelTimer = ablastr::parallelization::KernelTimer(
+ cost && (load_balance_costs_update_algo == LoadBalanceCostsUpdateAlgo::GpuClock),
+ cost_real);
#endif
// Inverse of Lorentz factor gamma