Skip to content

Commit

Permalink
use PMacc placeholder instead of boost::mpl::_1
Browse files Browse the repository at this point in the history
  • Loading branch information
psychocoderHPC committed Mar 30, 2023
1 parent 954c09c commit 9a2a80a
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
9 changes: 5 additions & 4 deletions include/picongpu/fields/incidentField/Solver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@

#include <pmacc/mappings/kernel/AreaMapping.hpp>
#include <pmacc/math/Vector.hpp>
#include <pmacc/meta/Apply.hpp>
#include <pmacc/meta/ForEach.hpp>
#include <pmacc/meta/conversion/MakeSeq.hpp>
#include <pmacc/traits/IsBaseTemplateOf.hpp>
Expand Down Expand Up @@ -633,10 +634,10 @@ namespace picongpu
parameters.direction = 1.0_X;
parameters.sourceTimeIteration = sourceTimeIteration;
parameters.timeIncrement = maxwellSolver::getTimeStep();
meta::ForEach<T_MinProfiles, ApplyUpdateE<boost::mpl::_1>> applyMinProfiles;
meta::ForEach<T_MinProfiles, ApplyUpdateE<pmacc::_1>> applyMinProfiles;
applyMinProfiles(parameters);
parameters.direction = -1.0_X;
meta::ForEach<T_MaxProfiles, ApplyUpdateE<boost::mpl::_1>> applyMaxProfiles;
meta::ForEach<T_MaxProfiles, ApplyUpdateE<pmacc::_1>> applyMaxProfiles;
applyMaxProfiles(parameters);
}

Expand Down Expand Up @@ -682,10 +683,10 @@ namespace picongpu
parameters.direction = 1.0_X;
parameters.sourceTimeIteration = sourceTimeIteration;
parameters.timeIncrement = 0.5_X * maxwellSolver::getTimeStep();
meta::ForEach<T_MinProfiles, ApplyUpdateB<boost::mpl::_1>> applyMinProfiles;
meta::ForEach<T_MinProfiles, ApplyUpdateB<pmacc::_1>> applyMinProfiles;
applyMinProfiles(parameters);
parameters.direction = -1.0_X;
meta::ForEach<T_MaxProfiles, ApplyUpdateB<boost::mpl::_1>> applyMaxProfiles;
meta::ForEach<T_MaxProfiles, ApplyUpdateB<pmacc::_1>> applyMaxProfiles;
applyMaxProfiles(parameters);
}

Expand Down
4 changes: 2 additions & 2 deletions include/picongpu/initialization/InitialiserController.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
#include <pmacc/Environment.hpp>
#include <pmacc/algorithms/math/defines/pi.hpp>
#include <pmacc/assert.hpp>
#include <pmacc/meta/Apply.hpp>
#include <pmacc/pluginSystem/PluginConnector.hpp>

namespace picongpu
Expand Down Expand Up @@ -229,8 +230,7 @@ namespace picongpu
{
using namespace fields;
using IncidentFieldProfiles = fields::incidentField::UniqueEnabledProfiles;
meta::ForEach<IncidentFieldProfiles, PrintIncidentFieldDispersion<boost::mpl::_1>>
printIncidentFieldDispersion;
meta::ForEach<IncidentFieldProfiles, PrintIncidentFieldDispersion<pmacc::_1>> printIncidentFieldDispersion;
printIncidentFieldDispersion();
}
};
Expand Down
3 changes: 2 additions & 1 deletion include/picongpu/plugins/output/images/Visualisation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
#include <pmacc/memory/boxes/SharedBox.hpp>
#include <pmacc/memory/buffers/GridBuffer.hpp>
#include <pmacc/memory/shared/Allocate.hpp>
#include <pmacc/meta/Apply.hpp>
#include <pmacc/meta/ForEach.hpp>
#include <pmacc/particles/algorithm/ForEach.hpp>
#include <pmacc/particles/memory/boxes/ParticlesBox.hpp>
Expand Down Expand Up @@ -164,7 +165,7 @@ namespace picongpu
HDINLINE static float_X getAmplitude()
{
using Profiles = fields::incidentField::UniqueEnabledProfiles;
meta::ForEach<Profiles, CalculateMaxAmplitude<boost::mpl::_1>> calculateMaxAmplitude;
meta::ForEach<Profiles, CalculateMaxAmplitude<pmacc::_1>> calculateMaxAmplitude;
auto maxAmplitude = 0.0_X;
calculateMaxAmplitude(maxAmplitude);
return maxAmplitude;
Expand Down
6 changes: 3 additions & 3 deletions include/picongpu/simulation/stage/AtomicPhysics.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
// actual call to kernel found here
#include <pmacc/Environment.hpp>
#include <pmacc/dataManagement/DataConnector.hpp>
#include <pmacc/meta/Apply.hpp>

#include <cstdint>

Expand Down Expand Up @@ -81,9 +82,8 @@ namespace picongpu
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, atomicPhysicsSolver<>>::type;

//! kernel to be called for each species
pmacc::meta::
ForEach<SpeciesWithAtomicPhysics, particles::atomicPhysics::CallAtomicPhysics<boost::mpl::_1>>
callAtomicPhysics;
pmacc::meta::ForEach<SpeciesWithAtomicPhysics, particles::atomicPhysics::CallAtomicPhysics<pmacc::_1>>
callAtomicPhysics;

/** Description of cell structure used for PIC-Simulations.
*
Expand Down
2 changes: 1 addition & 1 deletion include/pmacc/meta/Apply.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ namespace pmacc
struct ReplacePlaceholdersImpl<E<Ts...>, Args...>
{
using type = E<typename ReplacePlaceholdersImpl<Ts, Args...>::type...>;
// using type = typename E<typename ReplacePlaceholdersImpl<Ts, Args...>::type...>::type; // also calls
// nested ::type of E to mimic mpl::apply
//using type = typename E<typename ReplacePlaceholdersImpl<Ts, Args...>::type...>::type;
};
} // namespace detail

Expand Down

0 comments on commit 9a2a80a

Please sign in to comment.