From cc57059c72ae97a08369c97e13d899a12b87bd0b Mon Sep 17 00:00:00 2001 From: Bernhard Manfred Gruber Date: Tue, 21 Dec 2021 17:01:35 +0100 Subject: [PATCH] Replace mpl::apply --- .../algorithms/ShiftCoordinateSystem.hpp | 2 - .../absorber/exponential/Exponential.kernel | 2 +- .../initialization/InitialiserController.hpp | 2 +- include/picongpu/particles/InitFunctors.hpp | 21 ++--- include/picongpu/particles/Manipulate.hpp | 17 ++-- .../picongpu/particles/ParticlesFunctors.hpp | 10 +-- .../picongpu/particles/ParticlesInit.kernel | 3 +- .../picongpu/particles/collision/WithPeer.hpp | 6 +- .../picongpu/particles/debyeLength/Check.hpp | 4 +- .../densityProfiles/EveryNthCellImpl.hpp | 5 +- .../densityProfiles/FreeFormulaImpl.hpp | 5 +- .../densityProfiles/FromOpenPMDImpl.hpp | 3 +- .../densityProfiles/GaussianCloudImpl.hpp | 5 +- .../densityProfiles/GaussianImpl.hpp | 5 +- .../densityProfiles/HomogenousImpl.hpp | 5 +- .../densityProfiles/LinearExponentialImpl.hpp | 5 +- .../densityProfiles/SphereFlanksImpl.hpp | 5 +- include/picongpu/particles/filter/All.hpp | 5 +- .../filter/RelativeGlobalDomainPosition.hpp | 5 +- .../particles/filter/generic/Free.hpp | 5 +- .../particles/filter/generic/FreeRng.hpp | 5 +- .../filter/generic/FreeTotalCellOffset.def | 3 - .../filter/generic/FreeTotalCellOffset.hpp | 5 +- .../byCollision/ThomasFermi/ThomasFermi.def | 2 +- .../particles/ionization/byField/ADK/ADK.def | 4 +- .../particles/ionization/byField/BSI/BSI.def | 4 +- .../ionization/byField/Keldysh/Keldysh.def | 4 +- .../particles/manipulators/generic/Free.hpp | 5 +- .../manipulators/generic/FreeRng.hpp | 5 +- .../unary/FreeTotalCellOffset.hpp | 5 +- .../unary/FreeTotalCellOffsetRng.hpp | 5 +- .../ComputeGridValuePerFrame.def | 4 +- .../RandomPositionAndWeightingImpl.def | 3 - .../RandomPositionAndWeightingImpl.hpp | 3 - .../particles/startPosition/generic/Free.hpp | 5 +- .../startPosition/generic/FreeRng.hpp | 5 +- .../GenerateSolversIfSpeciesEligible.hpp | 5 +- .../particles/traits/GetIonizerList.hpp | 5 +- .../particles/traits/GetMarginPusher.hpp | 42 +++++----- .../picongpu/particles/traits/GetShape.hpp | 1 + .../picongpu/plugins/BinEnergyParticles.hpp | 4 +- .../picongpu/plugins/ChargeConservation.tpp | 4 +- include/picongpu/plugins/Emittance.hpp | 4 +- include/picongpu/plugins/EnergyParticles.hpp | 4 +- .../plugins/PhaseSpace/PhaseSpace.hpp | 2 +- .../plugins/PhaseSpace/PhaseSpace.tpp | 2 +- include/picongpu/plugins/PluginController.hpp | 26 +++--- .../picongpu/plugins/openPMD/WriteSpecies.hpp | 12 ++- .../plugins/openPMD/openPMDWriter.hpp | 28 +++---- .../plugins/openPMD/restart/LoadSpecies.hpp | 11 +-- .../plugins/output/WriteSpeciesCommon.hpp | 7 +- .../ParticleCalorimeter.hpp | 6 +- .../simulation/control/Simulation.hpp | 12 +-- .../simulation/stage/CurrentDeposition.hpp | 2 +- .../simulation/stage/IterationStart.hpp | 2 +- .../simulation/stage/ParticleBoundaries.hpp | 2 +- .../simulation/stage/ParticleIonization.hpp | 3 +- .../simulation/stage/RuntimeDensityFile.hpp | 2 +- include/pmacc/functor/Call.hpp | 5 +- include/pmacc/functor/Filtered.hpp | 18 +--- .../mappings/simulation/ResourceMonitor.tpp | 2 +- include/pmacc/math/MapTuple.hpp | 2 - .../pmacc/math/vector/compile-time/Vector.hpp | 2 - include/pmacc/meta/Apply.hpp | 82 +++++++++++++++++++ include/pmacc/meta/ForEach.hpp | 22 ++--- include/pmacc/meta/GetKeyFromAlias.hpp | 17 ++-- include/pmacc/meta/accessors/Identity.hpp | 5 +- include/pmacc/meta/accessors/Type.hpp | 5 +- include/pmacc/meta/conversion/ApplyGuard.hpp | 5 +- .../pmacc/meta/conversion/OperateOnSeq.hpp | 12 +-- include/pmacc/meta/conversion/Seq.hpp | 6 +- include/pmacc/meta/conversion/SeqToMap.hpp | 15 ++-- .../pmacc/meta/conversion/TypeToAliasPair.hpp | 32 ++++---- include/pmacc/meta/conversion/TypeToPair.hpp | 7 +- .../meta/errorHandlerPolicies/ReturnType.hpp | 5 +- .../meta/errorHandlerPolicies/ReturnValue.hpp | 5 +- .../ThrowValueNotFound.hpp | 3 +- .../pmacc/particles/ParticleDescription.hpp | 2 +- .../memory/buffers/ParticlesBuffer.hpp | 11 +-- .../memory/dataTypes/ListPointer.hpp | 4 +- .../particles/memory/dataTypes/Particle.hpp | 6 +- .../pmacc/particles/memory/frames/Frame.hpp | 9 +- .../pmacc/particles/meta/FindByNameOrType.hpp | 5 +- include/pmacc/types.hpp | 1 + .../include/picongpu/param/fileOutput.param | 3 - 85 files changed, 296 insertions(+), 368 deletions(-) create mode 100644 include/pmacc/meta/Apply.hpp diff --git a/include/picongpu/algorithms/ShiftCoordinateSystem.hpp b/include/picongpu/algorithms/ShiftCoordinateSystem.hpp index b7e754b1ad0..06d1aeb10b4 100644 --- a/include/picongpu/algorithms/ShiftCoordinateSystem.hpp +++ b/include/picongpu/algorithms/ShiftCoordinateSystem.hpp @@ -23,8 +23,6 @@ #include #include -#include - namespace picongpu { /** shift to new coordinate system diff --git a/include/picongpu/fields/absorber/exponential/Exponential.kernel b/include/picongpu/fields/absorber/exponential/Exponential.kernel index 3552ce25b71..cb60ea2c9b4 100644 --- a/include/picongpu/fields/absorber/exponential/Exponential.kernel +++ b/include/picongpu/fields/absorber/exponential/Exponential.kernel @@ -158,7 +158,7 @@ namespace picongpu using SimulationDimensions = pmacc::mp_iota>; - meta::ForEach> + meta::ForEach> absorbInAllDirections; absorbInAllDirections(worker, field, thickness, absorberStrength, mapper, relExchangeDir); diff --git a/include/picongpu/initialization/InitialiserController.hpp b/include/picongpu/initialization/InitialiserController.hpp index 706aae52327..c25d80b4d36 100644 --- a/include/picongpu/initialization/InitialiserController.hpp +++ b/include/picongpu/initialization/InitialiserController.hpp @@ -98,7 +98,7 @@ namespace picongpu * Calculate omega_p for each given species and create a `picLog::PHYSICS` * log message */ - template + template struct LogOmegaP { void operator()() diff --git a/include/picongpu/particles/InitFunctors.hpp b/include/picongpu/particles/InitFunctors.hpp index b27201003d5..86256f96d48 100644 --- a/include/picongpu/particles/InitFunctors.hpp +++ b/include/picongpu/particles/InitFunctors.hpp @@ -28,13 +28,13 @@ #include "picongpu/particles/manipulators/manipulators.def" #include +#include #include #include #include #include #include -#include namespace picongpu { @@ -85,18 +85,18 @@ namespace picongpu * @tparam T_SpeciesType type or name as PMACC_CSTRING of the used species, * see speciesDefinition.param */ - template + template struct CreateDensity { using SpeciesType = pmacc::particles::meta::FindByNameOrType_t; using FrameType = typename SpeciesType::FrameType; - using UserDensityFunctor = typename boost::mpl::apply1::type; + using UserDensityFunctor = pmacc::Apply; /* add interface for compile time interface validation*/ using DensityFunctor = densityProfiles::IProfile; - using UserPositionFunctor = typename boost::mpl::apply1::type; + using UserPositionFunctor = pmacc::Apply; /* add interface for compile time interface validation*/ using PositionFunctor = manipulators::IUnary; @@ -137,7 +137,7 @@ namespace picongpu template< typename T_Manipulator, typename T_SrcSpeciesType, - typename T_DestSpeciesType = boost::mpl::_1, + typename T_DestSpeciesType = pmacc::_1, typename T_SrcFilter = filter::All> struct ManipulateDerive { @@ -146,9 +146,9 @@ namespace picongpu using SrcSpeciesType = pmacc::particles::meta::FindByNameOrType_t; using SrcFrameType = typename SrcSpeciesType::FrameType; - using DestFunctor = typename boost::mpl::apply1::type; + using DestFunctor = pmacc::Apply; - using SrcFilter = typename boost::mpl::apply1::type; + using SrcFilter = pmacc::Apply; /* note: this is a FilteredManipulator with filter::All for * destination species, users can filter the destination directly via if's @@ -184,10 +184,7 @@ namespace picongpu * @tparam T_Filter picongpu::particles::filter, * particle filter type to select source particles to derive */ - template< - typename T_SrcSpeciesType, - typename T_DestSpeciesType = boost::mpl::_1, - typename T_Filter = filter::All> + template struct Derive : ManipulateDerive { }; @@ -208,7 +205,7 @@ namespace picongpu * @tparam T_SpeciesType type or name as PMACC_CSTRING of the particle species * to fill gaps in memory */ - template + template struct FillAllGaps { using SpeciesType = pmacc::particles::meta::FindByNameOrType_t; diff --git a/include/picongpu/particles/Manipulate.hpp b/include/picongpu/particles/Manipulate.hpp index 9e5956888b0..75b9bcbc150 100644 --- a/include/picongpu/particles/Manipulate.hpp +++ b/include/picongpu/particles/Manipulate.hpp @@ -29,8 +29,6 @@ #include #include -#include - #include #include @@ -48,8 +46,8 @@ namespace picongpu { private: using Species = pmacc::particles::meta::FindByNameOrType_t; - using SpeciesFunctor = typename boost::mpl::apply1::type; - using ParticleFilter = typename boost::mpl::apply1::type; + using SpeciesFunctor = pmacc::Apply; + using ParticleFilter = pmacc::Apply; public: using type = manipulators::IUnary; @@ -76,12 +74,12 @@ namespace picongpu * @tparam T_Filter picongpu::particles::filter, particle filter type to * select particles in `T_Species` to manipulate * @tparam T_Area area to process particles in operator()(currentStep), - * wrapped into std::integral_constant for boost::mpl::apply to work; + * wrapped into std::integral_constant for meta programming to work; * does not affect operator()(currentStep, areaMapperFactory) */ template< typename T_Manipulator, - typename T_Species = boost::mpl::_1, + typename T_Species = pmacc::_1, typename T_Filter = filter::All, typename T_Area = std::integral_constant> struct Manipulate @@ -99,7 +97,7 @@ namespace picongpu * workflow is as follows: * - select the species to manipulate, often by filtering VectorAllSpecies * - define a manipulator type; in case the manipulator has a species type - * as a template parameter, use the boost::mpl::_1 placeholder instead + * as a template parameter, use the pmacc::_1 placeholder instead * - define a filter type when necessary * - call manipulate() * @@ -135,8 +133,7 @@ namespace picongpu inline void manipulate(uint32_t const currentStep) { using SpeciesSeq = pmacc::ToSeq; - using Functor - = Manipulate>; + using Functor = Manipulate>; pmacc::meta::ForEach forEach; forEach(currentStep); } @@ -156,7 +153,7 @@ namespace picongpu inline void manipulate(uint32_t const currentStep, T_AreaMapperFactory const& areaMapperFactory) { using SpeciesSeq = pmacc::ToSeq; - using Functor = Manipulate; + using Functor = Manipulate; pmacc::meta::ForEach forEach; forEach(currentStep, areaMapperFactory); } diff --git a/include/picongpu/particles/ParticlesFunctors.hpp b/include/picongpu/particles/ParticlesFunctors.hpp index 2ee63ffa2ca..7a3e064bfd8 100644 --- a/include/picongpu/particles/ParticlesFunctors.hpp +++ b/include/picongpu/particles/ParticlesFunctors.hpp @@ -213,7 +213,7 @@ namespace picongpu /* push all species */ using VectorSpeciesWithPusher = typename pmacc::particles::traits::FilterByFlag>::type; - meta::ForEach> pushSpecies; + meta::ForEach> pushSpecies; pushSpecies(currentStep, eventInt, updateEventList); /* join all push events */ @@ -223,8 +223,7 @@ namespace picongpu } /* call communication for all species */ - meta::ForEach> - communicateSpecies; + meta::ForEach> communicateSpecies; communicateSpecies(updateEventList, commEventList); /* join all communication events */ @@ -246,7 +245,7 @@ namespace picongpu { using VectorSpeciesWithPusher = typename pmacc::particles::traits::FilterByFlag>::type; - meta::ForEach> removeOuterParticles; + meta::ForEach> removeOuterParticles; removeOuterParticles(currentStep); } }; @@ -326,8 +325,7 @@ namespace picongpu using hasIonizers = typename HasFlag>::type; if(hasIonizers::value) { - meta::ForEach> - particleIonization; + meta::ForEach> particleIonization; particleIonization(cellDesc, currentStep); } } diff --git a/include/picongpu/particles/ParticlesInit.kernel b/include/picongpu/particles/ParticlesInit.kernel index 4308b80f6af..cb2cb34336f 100644 --- a/include/picongpu/particles/ParticlesInit.kernel +++ b/include/picongpu/particles/ParticlesInit.kernel @@ -205,8 +205,7 @@ namespace picongpu using ParticleCleanedAttrList = typename ResolveAndRemoveFromSeq::type; - meta::ForEach> - setToDefault; + meta::ForEach> setToDefault; setToDefault(particle); } particle[multiMask_] = 1; diff --git a/include/picongpu/particles/collision/WithPeer.hpp b/include/picongpu/particles/collision/WithPeer.hpp index 5ef70218b6b..a98759f9376 100644 --- a/include/picongpu/particles/collision/WithPeer.hpp +++ b/include/picongpu/particles/collision/WithPeer.hpp @@ -24,10 +24,9 @@ #include "picongpu/particles/collision/InterCollision.hpp" #include "picongpu/particles/collision/IntraCollision.hpp" +#include #include -#include - #include @@ -106,8 +105,7 @@ namespace picongpu using PeerSpecies = pmacc::particles::meta::FindByNameOrType_t; - using CollisionFunctor = - typename boost::mpl::apply2::type; + using CollisionFunctor = pmacc::Apply; detail::WithPeer{}( deviceHeap, diff --git a/include/picongpu/particles/debyeLength/Check.hpp b/include/picongpu/particles/debyeLength/Check.hpp index c925201e680..2edd9846978 100644 --- a/include/picongpu/particles/debyeLength/Check.hpp +++ b/include/picongpu/particles/debyeLength/Check.hpp @@ -97,7 +97,7 @@ namespace picongpu HINLINE std::uint32_t countElectronLikeSpecies() { Counter::value() = 0u; - meta::ForEach> count; + meta::ForEach> count; count(); return Counter::value(); } @@ -203,7 +203,7 @@ namespace picongpu } else { - meta::ForEach> checkDebyeLength; + meta::ForEach> checkDebyeLength; checkDebyeLength(cellDescription, isPrinting); } } diff --git a/include/picongpu/particles/densityProfiles/EveryNthCellImpl.hpp b/include/picongpu/particles/densityProfiles/EveryNthCellImpl.hpp index 6372b6d41c3..42a3341e67b 100644 --- a/include/picongpu/particles/densityProfiles/EveryNthCellImpl.hpp +++ b/include/picongpu/particles/densityProfiles/EveryNthCellImpl.hpp @@ -37,10 +37,7 @@ namespace picongpu using SkipCells = typename pmacc::math::CT::shrinkTo::type; template - struct apply - { - using type = EveryNthCellImpl; - }; + using fn = EveryNthCellImpl; HINLINE EveryNthCellImpl(uint32_t currentStep) diff --git a/include/picongpu/particles/densityProfiles/FreeFormulaImpl.hpp b/include/picongpu/particles/densityProfiles/FreeFormulaImpl.hpp index 334b9796028..f3a7a860b48 100644 --- a/include/picongpu/particles/densityProfiles/FreeFormulaImpl.hpp +++ b/include/picongpu/particles/densityProfiles/FreeFormulaImpl.hpp @@ -35,10 +35,7 @@ namespace picongpu using UserFunctor = particles::functor::User; template - struct apply - { - using type = FreeFormulaImpl; - }; + using fn = FreeFormulaImpl; HINLINE FreeFormulaImpl(uint32_t currentStep) : UserFunctor(currentStep) { diff --git a/include/picongpu/particles/densityProfiles/FromOpenPMDImpl.hpp b/include/picongpu/particles/densityProfiles/FromOpenPMDImpl.hpp index e8f666d9cb9..d1be1cb8c78 100644 --- a/include/picongpu/particles/densityProfiles/FromOpenPMDImpl.hpp +++ b/include/picongpu/particles/densityProfiles/FromOpenPMDImpl.hpp @@ -305,14 +305,13 @@ namespace picongpu } // namespace detail /** Wrapper to be used in density.param, compatible with other density definitions - * - * Hooks internal implementation in detail:: to boost::mpl::apply * * @tparam T_ParamClass parameter type */ template struct FromOpenPMDImpl : public T_ParamClass { + // TODO(bgruber): is this supposed to hook into MPL? I cannot find where this is used. template struct apply { diff --git a/include/picongpu/particles/densityProfiles/GaussianCloudImpl.hpp b/include/picongpu/particles/densityProfiles/GaussianCloudImpl.hpp index f7b4f2ddbdd..c5e3ab55e9f 100644 --- a/include/picongpu/particles/densityProfiles/GaussianCloudImpl.hpp +++ b/include/picongpu/particles/densityProfiles/GaussianCloudImpl.hpp @@ -34,10 +34,7 @@ namespace picongpu using ParamClass = T_ParamClass; template - struct apply - { - using type = GaussianCloudImpl; - }; + using fn = GaussianCloudImpl; HINLINE GaussianCloudImpl(uint32_t currentStep) { diff --git a/include/picongpu/particles/densityProfiles/GaussianImpl.hpp b/include/picongpu/particles/densityProfiles/GaussianImpl.hpp index 4252e550301..bb8763af31a 100644 --- a/include/picongpu/particles/densityProfiles/GaussianImpl.hpp +++ b/include/picongpu/particles/densityProfiles/GaussianImpl.hpp @@ -34,10 +34,7 @@ namespace picongpu using ParamClass = T_ParamClass; template - struct apply - { - using type = GaussianImpl; - }; + using fn = GaussianImpl; HINLINE GaussianImpl(uint32_t currentStep) { diff --git a/include/picongpu/particles/densityProfiles/HomogenousImpl.hpp b/include/picongpu/particles/densityProfiles/HomogenousImpl.hpp index 2c0eef51d51..e03b0f13ac1 100644 --- a/include/picongpu/particles/densityProfiles/HomogenousImpl.hpp +++ b/include/picongpu/particles/densityProfiles/HomogenousImpl.hpp @@ -29,10 +29,7 @@ namespace picongpu struct HomogenousImpl { template - struct apply - { - using type = HomogenousImpl; - }; + using fn = HomogenousImpl; HINLINE HomogenousImpl(uint32_t currentStep) { diff --git a/include/picongpu/particles/densityProfiles/LinearExponentialImpl.hpp b/include/picongpu/particles/densityProfiles/LinearExponentialImpl.hpp index 4f637c400af..d0445821900 100644 --- a/include/picongpu/particles/densityProfiles/LinearExponentialImpl.hpp +++ b/include/picongpu/particles/densityProfiles/LinearExponentialImpl.hpp @@ -32,10 +32,7 @@ namespace picongpu using ParamClass = T_ParamClass; template - struct apply - { - using type = LinearExponentialImpl; - }; + using fn = LinearExponentialImpl; HINLINE LinearExponentialImpl(uint32_t currentStep) { diff --git a/include/picongpu/particles/densityProfiles/SphereFlanksImpl.hpp b/include/picongpu/particles/densityProfiles/SphereFlanksImpl.hpp index 2673200e3e8..4999d5b1223 100644 --- a/include/picongpu/particles/densityProfiles/SphereFlanksImpl.hpp +++ b/include/picongpu/particles/densityProfiles/SphereFlanksImpl.hpp @@ -33,10 +33,7 @@ namespace picongpu using ParamClass = T_ParamClass; template - struct apply - { - using type = SphereFlanksImpl; - }; + using fn = SphereFlanksImpl; HINLINE SphereFlanksImpl(uint32_t currentStep) { diff --git a/include/picongpu/particles/filter/All.hpp b/include/picongpu/particles/filter/All.hpp index 385cf68abbc..32f3f6ae4a0 100644 --- a/include/picongpu/particles/filter/All.hpp +++ b/include/picongpu/particles/filter/All.hpp @@ -54,10 +54,7 @@ namespace picongpu struct All { template - struct apply - { - using type = All; - }; + using fn = All; /** create filter for the accelerator * diff --git a/include/picongpu/particles/filter/RelativeGlobalDomainPosition.hpp b/include/picongpu/particles/filter/RelativeGlobalDomainPosition.hpp index eead404f5c5..4795a036f01 100644 --- a/include/picongpu/particles/filter/RelativeGlobalDomainPosition.hpp +++ b/include/picongpu/particles/filter/RelativeGlobalDomainPosition.hpp @@ -102,10 +102,7 @@ namespace picongpu using Params = T_Params; template - struct apply - { - using type = RelativeGlobalDomainPosition; - }; + using fn = RelativeGlobalDomainPosition; HINLINE RelativeGlobalDomainPosition() { diff --git a/include/picongpu/particles/filter/generic/Free.hpp b/include/picongpu/particles/filter/generic/Free.hpp index 87811fd009f..89ced48e462 100644 --- a/include/picongpu/particles/filter/generic/Free.hpp +++ b/include/picongpu/particles/filter/generic/Free.hpp @@ -74,10 +74,7 @@ namespace picongpu using Functor = functor::User; template - struct apply - { - using type = Free; - }; + using fn = Free; /** constructor * diff --git a/include/picongpu/particles/filter/generic/FreeRng.hpp b/include/picongpu/particles/filter/generic/FreeRng.hpp index 2d1bc1ff7e4..165ef79efa2 100644 --- a/include/picongpu/particles/filter/generic/FreeRng.hpp +++ b/include/picongpu/particles/filter/generic/FreeRng.hpp @@ -79,10 +79,7 @@ namespace picongpu , private picongpu::particles::functor::misc::Rng { template - struct apply - { - using type = FreeRng; - }; + using fn = FreeRng; using RngGenerator = picongpu::particles::functor::misc::Rng; diff --git a/include/picongpu/particles/filter/generic/FreeTotalCellOffset.def b/include/picongpu/particles/filter/generic/FreeTotalCellOffset.def index 4a61f2bb567..c9bb08ab6ca 100644 --- a/include/picongpu/particles/filter/generic/FreeTotalCellOffset.def +++ b/include/picongpu/particles/filter/generic/FreeTotalCellOffset.def @@ -21,9 +21,6 @@ #include "picongpu/simulation_defines.hpp" -#include - - namespace picongpu { namespace particles diff --git a/include/picongpu/particles/filter/generic/FreeTotalCellOffset.hpp b/include/picongpu/particles/filter/generic/FreeTotalCellOffset.hpp index 442966302e5..33677222adb 100644 --- a/include/picongpu/particles/filter/generic/FreeTotalCellOffset.hpp +++ b/include/picongpu/particles/filter/generic/FreeTotalCellOffset.hpp @@ -91,10 +91,7 @@ namespace picongpu using Functor = functor::User; template - struct apply - { - using type = FreeTotalCellOffset; - }; + using fn = FreeTotalCellOffset; /** constructor * diff --git a/include/picongpu/particles/ionization/byCollision/ThomasFermi/ThomasFermi.def b/include/picongpu/particles/ionization/byCollision/ThomasFermi/ThomasFermi.def index 1ae4e8a70e3..cc89d2d1c50 100644 --- a/include/picongpu/particles/ionization/byCollision/ThomasFermi/ThomasFermi.def +++ b/include/picongpu/particles/ionization/byCollision/ThomasFermi/ThomasFermi.def @@ -31,7 +31,7 @@ namespace picongpu * * @tparam T_DestSpecies electron species to be created * @tparam T_SrcSpecies particle species that is ionized - * default is boost::mpl placeholder because specialization + * default is placeholder because specialization * cannot be known in list of particle species' flags * @see speciesDefinition.param */ diff --git a/include/picongpu/particles/ionization/byField/ADK/ADK.def b/include/picongpu/particles/ionization/byField/ADK/ADK.def index ee004f3d861..105fab537fb 100644 --- a/include/picongpu/particles/ionization/byField/ADK/ADK.def +++ b/include/picongpu/particles/ionization/byField/ADK/ADK.def @@ -34,7 +34,7 @@ namespace picongpu * @tparam T_DestSpecies electron species to be created * @tparam T_IonizationCurrent select type of ionization current (None or EnergyConservation) * @tparam T_SrcSpecies ion species to be ionized - * default is boost::mpl placeholder because specialization + * default is placeholder because specialization * cannot be known in list of particle species' flags * @see speciesDefinition.param */ @@ -42,7 +42,7 @@ namespace picongpu typename T_IonizationAlgorithm, typename T_DestSpecies, typename T_IonizationCurrent, - typename T_SrcSpecies = boost::mpl::_1> + typename T_SrcSpecies = pmacc::_1> struct ADK_Impl; /** Ammosov-Delone-Krainov tunneling model - linear laser polarization diff --git a/include/picongpu/particles/ionization/byField/BSI/BSI.def b/include/picongpu/particles/ionization/byField/BSI/BSI.def index b3db73dbf9a..b5156ffe571 100644 --- a/include/picongpu/particles/ionization/byField/BSI/BSI.def +++ b/include/picongpu/particles/ionization/byField/BSI/BSI.def @@ -34,7 +34,7 @@ namespace picongpu * @tparam T_DestSpecies electron species to be created * @tparam T_IonizationCurrent select type of ionization current (None or EnergyConservation) * @tparam T_SrcSpecies particle species that is ionized - * default is boost::mpl placeholder because specialization + * default is placeholder because specialization * cannot be known in list of particle species' flags * @see speciesDefinition.param */ @@ -42,7 +42,7 @@ namespace picongpu typename T_IonizationAlgorithm, typename T_DestSpecies, typename T_IonizationCurrent, - typename T_SrcSpecies = boost::mpl::_1> + typename T_SrcSpecies = pmacc::_1> struct BSI_Impl; /** Barrier Suppression Ionization - Hydrogen-Like diff --git a/include/picongpu/particles/ionization/byField/Keldysh/Keldysh.def b/include/picongpu/particles/ionization/byField/Keldysh/Keldysh.def index bd26daa579b..984b6f69ba8 100644 --- a/include/picongpu/particles/ionization/byField/Keldysh/Keldysh.def +++ b/include/picongpu/particles/ionization/byField/Keldysh/Keldysh.def @@ -34,7 +34,7 @@ namespace picongpu * @tparam T_DestSpecies electron species to be created * @tparam T_IonizationCurrent select type of ionization current (None or EnergyConservation) * @tparam T_SrcSpecies ion species to be ionized - * default is boost::mpl placeholder because specialization + * default is placeholder because specialization * cannot be known in list of particle species' flags * @see speciesDefinition.param */ @@ -42,7 +42,7 @@ namespace picongpu typename T_IonizationAlgorithm, typename T_DestSpecies, typename T_IonizationCurrent, - typename T_SrcSpecies = boost::mpl::_1> + typename T_SrcSpecies = pmacc::_1> struct Keldysh_Impl; /** Keldysh ionization model diff --git a/include/picongpu/particles/manipulators/generic/Free.hpp b/include/picongpu/particles/manipulators/generic/Free.hpp index feebde32319..e8acadce73d 100644 --- a/include/picongpu/particles/manipulators/generic/Free.hpp +++ b/include/picongpu/particles/manipulators/generic/Free.hpp @@ -72,10 +72,7 @@ namespace picongpu using Functor = functor::User; template - struct apply - { - using type = Free; - }; + using fn = Free; /** constructor * diff --git a/include/picongpu/particles/manipulators/generic/FreeRng.hpp b/include/picongpu/particles/manipulators/generic/FreeRng.hpp index dae82597987..b0c98af3d37 100644 --- a/include/picongpu/particles/manipulators/generic/FreeRng.hpp +++ b/include/picongpu/particles/manipulators/generic/FreeRng.hpp @@ -79,10 +79,7 @@ namespace picongpu , private picongpu::particles::functor::misc::Rng { template - struct apply - { - using type = FreeRng; - }; + using fn = FreeRng; using RngGenerator = picongpu::particles::functor::misc::Rng; diff --git a/include/picongpu/particles/manipulators/unary/FreeTotalCellOffset.hpp b/include/picongpu/particles/manipulators/unary/FreeTotalCellOffset.hpp index d5c2e65e75a..047add8400e 100644 --- a/include/picongpu/particles/manipulators/unary/FreeTotalCellOffset.hpp +++ b/include/picongpu/particles/manipulators/unary/FreeTotalCellOffset.hpp @@ -84,10 +84,7 @@ namespace picongpu using Functor = functor::User; template - struct apply - { - using type = FreeTotalCellOffset; - }; + using fn = FreeTotalCellOffset; /** constructor * diff --git a/include/picongpu/particles/manipulators/unary/FreeTotalCellOffsetRng.hpp b/include/picongpu/particles/manipulators/unary/FreeTotalCellOffsetRng.hpp index 51049487376..3029f0871f7 100644 --- a/include/picongpu/particles/manipulators/unary/FreeTotalCellOffsetRng.hpp +++ b/include/picongpu/particles/manipulators/unary/FreeTotalCellOffsetRng.hpp @@ -93,10 +93,7 @@ namespace picongpu using Distribution = T_Distribution; template - struct apply - { - using type = FreeTotalCellOffsetRng; - }; + using fn = FreeTotalCellOffsetRng; /** constructor * diff --git a/include/picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def b/include/picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def index e3e088b2c50..3dcf8c47dc3 100644 --- a/include/picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def +++ b/include/picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def @@ -43,8 +43,6 @@ #include -#include - #include @@ -197,7 +195,7 @@ namespace picongpu using FilteredAttribute = FilteredDerivedAttribute; using type = typename traits::GenerateSolversIfSpeciesEligible< - CreateFieldTmpOperation, + CreateFieldTmpOperation, SeqSpecies, FilteredAttribute>::type; }; diff --git a/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.def b/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.def index 8d45e006cab..8586cab5e8f 100644 --- a/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.def +++ b/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.def @@ -25,9 +25,6 @@ #include -#include - - namespace picongpu { namespace particles diff --git a/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.hpp b/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.hpp index b024e56dabc..dbfad2bbaa9 100644 --- a/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.hpp +++ b/include/picongpu/particles/startPosition/RandomPositionAndWeightingImpl.hpp @@ -25,9 +25,6 @@ #include "picongpu/particles/startPosition/detail/WeightMacroParticles.hpp" #include "picongpu/particles/startPosition/generic/FreeRng.def" -#include - - namespace picongpu { namespace particles diff --git a/include/picongpu/particles/startPosition/generic/Free.hpp b/include/picongpu/particles/startPosition/generic/Free.hpp index 61c5a711a5d..90ce0242d00 100644 --- a/include/picongpu/particles/startPosition/generic/Free.hpp +++ b/include/picongpu/particles/startPosition/generic/Free.hpp @@ -79,10 +79,7 @@ namespace picongpu using Functor = T_Functor; template - struct apply - { - using type = Free; - }; + using fn = Free; /** constructor * diff --git a/include/picongpu/particles/startPosition/generic/FreeRng.hpp b/include/picongpu/particles/startPosition/generic/FreeRng.hpp index 96df8d0dbc9..a007489441a 100644 --- a/include/picongpu/particles/startPosition/generic/FreeRng.hpp +++ b/include/picongpu/particles/startPosition/generic/FreeRng.hpp @@ -84,10 +84,7 @@ namespace picongpu , private picongpu::particles::functor::misc::Rng { template - struct apply - { - using type = FreeRng; - }; + using fn = FreeRng; using RngGenerator = picongpu::particles::functor::misc::Rng; diff --git a/include/picongpu/particles/traits/GenerateSolversIfSpeciesEligible.hpp b/include/picongpu/particles/traits/GenerateSolversIfSpeciesEligible.hpp index 6f56b4160d2..f42395ecec8 100644 --- a/include/picongpu/particles/traits/GenerateSolversIfSpeciesEligible.hpp +++ b/include/picongpu/particles/traits/GenerateSolversIfSpeciesEligible.hpp @@ -21,10 +21,9 @@ #include "picongpu/particles/traits/SpeciesEligibleForSolver.hpp" +#include #include -#include - namespace picongpu { namespace particles @@ -64,7 +63,7 @@ namespace picongpu using SeqEligibleSpecies = pmacc::mp_copy_if; template - using Op = typename boost::mpl::apply1::type; + using Op = pmacc::Apply; using type = pmacc::mp_transform; }; } // namespace traits diff --git a/include/picongpu/particles/traits/GetIonizerList.hpp b/include/picongpu/particles/traits/GetIonizerList.hpp index fdc8a958f2b..fdbf6c91428 100644 --- a/include/picongpu/particles/traits/GetIonizerList.hpp +++ b/include/picongpu/particles/traits/GetIonizerList.hpp @@ -21,13 +21,12 @@ #include "picongpu/simulation_defines.hpp" +#include #include #include #include #include -#include - namespace picongpu { @@ -57,7 +56,7 @@ namespace picongpu using type = typename pmacc::OperateOnSeq< FoundIonizerList, - boost::mpl::apply1, + pmacc::Apply, pmacc::meta::accessors::Type<>>::type; }; diff --git a/include/picongpu/particles/traits/GetMarginPusher.hpp b/include/picongpu/particles/traits/GetMarginPusher.hpp index 5ac50a39ee4..355f15c88f0 100644 --- a/include/picongpu/particles/traits/GetMarginPusher.hpp +++ b/include/picongpu/particles/traits/GetMarginPusher.hpp @@ -36,29 +36,17 @@ namespace picongpu * @tparam T_GetLowerMargin lower margin for pusher getter type * @tparam T_GetUpperMargin upper margin for pusher getter type */ - template< - typename T_Species, - typename T_GetLowerMargin = GetLowerMargin>, - typename T_GetUpperMargin = GetUpperMargin>> + template struct GetMarginPusher { - using AddLowerMargins - = pmacc::math::CT::add>, T_GetLowerMargin>; - using LowerMargin = typename boost::mpl::apply::type; + private: + using Interpolation = typename GetInterpolation::type; - using AddUpperMargins - = pmacc::math::CT::add>, T_GetUpperMargin>; - using UpperMargin = typename boost::mpl::apply::type; - }; - - /** Get lower margin of a pusher for species - * - * @tparam T_Species particle species type - */ - template - struct GetLowerMarginPusher - { - using type = typename traits::GetMarginPusher::LowerMargin; + public: + using LowerMargin = + typename pmacc::math::CT::add::type, T_GetLowerMargin>::type; + using UpperMargin = + typename pmacc::math::CT::add::type, T_GetUpperMargin>::type; }; /** Get lower margin of the given pusher for species @@ -78,14 +66,13 @@ namespace picongpu typename GetUpperMargin::type>::LowerMargin; }; - /** Get upper margin of a pusher for species + /** Get lower margin of a pusher for species * * @tparam T_Species particle species type */ template - struct GetUpperMarginPusher + struct GetLowerMarginPusher : GetLowerMarginForPusher::type> { - using type = typename traits::GetMarginPusher::UpperMargin; }; /** Get upper margin of the given pusher for species @@ -105,5 +92,14 @@ namespace picongpu typename GetUpperMargin::type>::UpperMargin; }; + /** Get upper margin of a pusher for species + * + * @tparam T_Species particle species type + */ + template + struct GetUpperMarginPusher : GetUpperMarginForPusher::type> + { + }; + } // namespace traits } // namespace picongpu diff --git a/include/picongpu/particles/traits/GetShape.hpp b/include/picongpu/particles/traits/GetShape.hpp index b8a91bba1dd..926e8caeddc 100644 --- a/include/picongpu/particles/traits/GetShape.hpp +++ b/include/picongpu/particles/traits/GetShape.hpp @@ -33,6 +33,7 @@ namespace picongpu { using type = typename pmacc::traits::Resolve< typename GetFlagType>::type>::type; + static_assert(!std::is_void_v); }; } // namespace traits diff --git a/include/picongpu/plugins/BinEnergyParticles.hpp b/include/picongpu/plugins/BinEnergyParticles.hpp index 9a4bed0b7c3..bfd3b3af6ff 100644 --- a/include/picongpu/plugins/BinEnergyParticles.hpp +++ b/include/picongpu/plugins/BinEnergyParticles.hpp @@ -230,7 +230,7 @@ namespace picongpu boost::program_options::options_description& desc, std::string const& masterPrefix = std::string{}) override { - meta::ForEach> getEligibleFilterNames; + meta::ForEach> getEligibleFilterNames; getEligibleFilterNames(allowedFilters); concatenatedFilterNames = plugins::misc::concatenateToString(allowedFilters, ", "); @@ -448,7 +448,7 @@ namespace picongpu mapper, std::placeholders::_1); - meta::ForEach>{}( + meta::ForEach>{}( m_help->filter.get(m_id), currentStep, bindKernel); diff --git a/include/picongpu/plugins/ChargeConservation.tpp b/include/picongpu/plugins/ChargeConservation.tpp index 4a34ebc7155..0c03f5b70d9 100644 --- a/include/picongpu/plugins/ChargeConservation.tpp +++ b/include/picongpu/plugins/ChargeConservation.tpp @@ -197,8 +197,8 @@ namespace picongpu /* calculate and add the charge density values from all species in FieldTmp */ meta::ForEach< EligibleSpecies, - picongpu::detail::ComputeChargeDensity>, - boost::mpl::_1> + picongpu::detail::ComputeChargeDensity>, + pmacc::_1> computeChargeDensity; computeChargeDensity(fieldTmp.get(), currentStep); diff --git a/include/picongpu/plugins/Emittance.hpp b/include/picongpu/plugins/Emittance.hpp index b1c1cc7fb0c..bfe4f784f65 100644 --- a/include/picongpu/plugins/Emittance.hpp +++ b/include/picongpu/plugins/Emittance.hpp @@ -237,7 +237,7 @@ namespace picongpu boost::program_options::options_description& desc, std::string const& masterPrefix = std::string{}) override { - meta::ForEach> getEligibleFilterNames; + meta::ForEach> getEligibleFilterNames; getEligibleFilterNames(allowedFilters); concatenatedFilterNames = plugins::misc::concatenateToString(allowedFilters, ", "); @@ -489,7 +489,7 @@ namespace picongpu mapper, std::placeholders::_1); - meta::ForEach>{}( + meta::ForEach>{}( m_help->filter.get(m_id), currentStep, binaryKernel); diff --git a/include/picongpu/plugins/EnergyParticles.hpp b/include/picongpu/plugins/EnergyParticles.hpp index a59b78c8877..a77b6fe6f95 100644 --- a/include/picongpu/plugins/EnergyParticles.hpp +++ b/include/picongpu/plugins/EnergyParticles.hpp @@ -195,7 +195,7 @@ namespace picongpu boost::program_options::options_description& desc, std::string const& masterPrefix = std::string{}) override { - meta::ForEach> getEligibleFilterNames; + meta::ForEach> getEligibleFilterNames; getEligibleFilterNames(allowedFilters); concatenatedFilterNames = plugins::misc::concatenateToString(allowedFilters, ", "); @@ -360,7 +360,7 @@ namespace picongpu mapper, std::placeholders::_1); - meta::ForEach>{}( + meta::ForEach>{}( m_help->filter.get(m_id), currentStep, binaryKernel); diff --git a/include/picongpu/plugins/PhaseSpace/PhaseSpace.hpp b/include/picongpu/plugins/PhaseSpace/PhaseSpace.hpp index bac9ce7b44e..c036d885f16 100644 --- a/include/picongpu/plugins/PhaseSpace/PhaseSpace.hpp +++ b/include/picongpu/plugins/PhaseSpace/PhaseSpace.hpp @@ -100,7 +100,7 @@ namespace picongpu boost::program_options::options_description& desc, std::string const& masterPrefix = std::string{}) override { - meta::ForEach> getEligibleFilterNames; + meta::ForEach> getEligibleFilterNames; getEligibleFilterNames(allowedFilters); concatenatedFilterNames = plugins::misc::concatenateToString(allowedFilters, ", "); diff --git a/include/picongpu/plugins/PhaseSpace/PhaseSpace.tpp b/include/picongpu/plugins/PhaseSpace/PhaseSpace.tpp index 0b0fa499f40..7e58041cc84 100644 --- a/include/picongpu/plugins/PhaseSpace/PhaseSpace.tpp +++ b/include/picongpu/plugins/PhaseSpace/PhaseSpace.tpp @@ -186,7 +186,7 @@ namespace picongpu // particle filter std::placeholders::_1); - meta::ForEach>{}( + meta::ForEach>{}( m_help->filter.get(m_id), currentStep, bindFunctor); diff --git a/include/picongpu/plugins/PluginController.hpp b/include/picongpu/plugins/PluginController.hpp index dd15c5b8acd..d6a5be2f399 100644 --- a/include/picongpu/plugins/PluginController.hpp +++ b/include/picongpu/plugins/PluginController.hpp @@ -112,9 +112,9 @@ namespace picongpu * with two components */ template - using Apply = typename boost::mpl::apply1< + using Apply = pmacc::Apply< pmacc::mp_at>, - pmacc::mp_at>>::type; + pmacc::mp_at>>; /** Check the combination Species+Plugin in the Tuple * @@ -157,24 +157,24 @@ namespace picongpu /* define species plugins */ using UnspecializedSpeciesPlugins = pmacc::mp_list< - plugins::multi::Master>, - plugins::multi::Master>, - plugins::multi::Master>, - CountParticles, - PngPlugin>, - plugins::transitionRadiation::TransitionRadiation + plugins::multi::Master>, + plugins::multi::Master>, + plugins::multi::Master>, + CountParticles, + PngPlugin>, + plugins::transitionRadiation::TransitionRadiation #if ENABLE_OPENPMD , - plugins::radiation::Radiation + plugins::radiation::Radiation #endif #if(ENABLE_OPENPMD == 1) , - plugins::multi::Master>, - plugins::multi::Master> + plugins::multi::Master>, + plugins::multi::Master> #endif #if(ENABLE_OPENPMD == 1) , - PerSuperCell + PerSuperCell #endif >; @@ -194,7 +194,7 @@ namespace picongpu */ virtual void init() { - meta::ForEach> pushBack; + meta::ForEach> pushBack; pushBack(plugins); } diff --git a/include/picongpu/plugins/openPMD/WriteSpecies.hpp b/include/picongpu/plugins/openPMD/WriteSpecies.hpp index 2d405acf81b..c9847bc5e07 100644 --- a/include/picongpu/plugins/openPMD/WriteSpecies.hpp +++ b/include/picongpu/plugins/openPMD/WriteSpecies.hpp @@ -43,8 +43,6 @@ #include #include -#include - #include #include // std::remove_reference_t @@ -107,14 +105,14 @@ namespace picongpu { /* malloc host memory */ log("openPMD: (begin) malloc host memory: %1%") % name; - meta::ForEach> mallocMem; + meta::ForEach> mallocMem; mallocMem(hostFrame, myNumParticles); log("openPMD: ( end ) malloc host memory: %1%") % name; } void free(openPMDFrameType& hostFrame) override { - meta::ForEach> freeMem; + meta::ForEach> freeMem; freeMem(hostFrame); } @@ -177,14 +175,14 @@ namespace picongpu { log("openPMD: (begin) malloc mapped memory: %1%") % name; /*malloc mapped memory*/ - meta::ForEach> mallocMem; + meta::ForEach> mallocMem; mallocMem(mappedFrame, myNumParticles); log("openPMD: ( end ) malloc mapped memory: %1%") % name; } void free(openPMDFrameType& mappedFrame) override { - meta::ForEach> freeMem; + meta::ForEach> freeMem; freeMem(mappedFrame); } @@ -418,7 +416,7 @@ namespace picongpu log("openPMD: (begin) write particle records for %1%") % T_SpeciesFilter::getName(); - meta::ForEach> + meta::ForEach> writeToOpenPMD; writeToOpenPMD( params, diff --git a/include/picongpu/plugins/openPMD/openPMDWriter.hpp b/include/picongpu/plugins/openPMD/openPMDWriter.hpp index 41ccbf495bb..0f4d10f8194 100644 --- a/include/picongpu/plugins/openPMD/openPMDWriter.hpp +++ b/include/picongpu/plugins/openPMD/openPMDWriter.hpp @@ -69,8 +69,6 @@ #include #include -#include - #include #include @@ -278,11 +276,11 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. boost::program_options::options_description& desc, std::string const& masterPrefix = std::string{}) override { - meta::ForEach> + meta::ForEach> getEligibleDataSourceNames; getEligibleDataSourceNames(allowedDataSources); - meta::ForEach> appendFieldSourceNames; + meta::ForEach> appendFieldSourceNames; appendFieldSourceNames(allowedDataSources); // string list with all possible particle sources @@ -1109,11 +1107,11 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. mThreadParams.localWindowToDomainOffset = DataSpace::create(0); /* load all fields */ - meta::ForEach> ForEachLoadFields; + meta::ForEach> ForEachLoadFields; ForEachLoadFields(&mThreadParams); /* load all particles */ - meta::ForEach> ForEachLoadSpecies; + meta::ForEach> ForEachLoadSpecies; ForEachLoadSpecies(&mThreadParams, restartChunkSize); loadRngStates(&mThreadParams); @@ -1201,7 +1199,7 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. * them for sure (checkpoint) or just some user-defined species * (dump) */ - meta::ForEach> copySpeciesToHost; + meta::ForEach> copySpeciesToHost; copySpeciesToHost(); lastSpeciesSyncStep = currentStep; } @@ -1537,19 +1535,19 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. log("openPMD: (begin) writing fields."); if(threadParams->isCheckpoint) { - meta::ForEach> ForEachGetFields; + meta::ForEach> ForEachGetFields; ForEachGetFields(threadParams); } else { if(dumpFields) { - meta::ForEach> ForEachGetFields; + meta::ForEach> ForEachGetFields; ForEachGetFields(threadParams); } // move over all field data sources - meta::ForEach>{}( + meta::ForEach>{}( vectorOfDataSourceNames, threadParams); } @@ -1563,8 +1561,8 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. meta::ForEach< FileCheckpointParticles, WriteSpecies< - plugins::misc::SpeciesFilter, - plugins::misc::UnfilteredSpecies>> + plugins::misc::SpeciesFilter, + plugins::misc::UnfilteredSpecies>> writeSpecies; writeSpecies(threadParams, particleToTotalDomainOffset); } @@ -1574,15 +1572,13 @@ make sure that environment variable OPENPMD_BP_BACKEND is not set to ADIOS1. if(dumpAllParticles) { // move over all species defined in FileOutputParticles - meta::ForEach< - FileOutputParticles, - WriteSpecies>> + meta::ForEach>> writeSpecies; writeSpecies(threadParams, particleToTotalDomainOffset); } // move over all species data sources - meta::ForEach>{}( + meta::ForEach>{}( vectorOfDataSourceNames, threadParams, particleToTotalDomainOffset); diff --git a/include/picongpu/plugins/openPMD/restart/LoadSpecies.hpp b/include/picongpu/plugins/openPMD/restart/LoadSpecies.hpp index 195b4e1ebe8..61f5600ad0d 100644 --- a/include/picongpu/plugins/openPMD/restart/LoadSpecies.hpp +++ b/include/picongpu/plugins/openPMD/restart/LoadSpecies.hpp @@ -32,8 +32,6 @@ #include #include -#include - #include #include @@ -134,12 +132,11 @@ namespace picongpu openPMDFrameType mappedFrame; log("openPMD: malloc mapped memory: %1%") % speciesName; /*malloc mapped memory*/ - meta::ForEach> mallocMem; + meta::ForEach> mallocMem; mallocMem(mappedFrame, totalNumParticles); - meta:: - ForEach> - loadAttributes; + meta::ForEach> + loadAttributes; loadAttributes(params, mappedFrame, particleSpecies, particleOffset, totalNumParticles); if(totalNumParticles != 0) @@ -155,7 +152,7 @@ namespace picongpu picLog::INPUT_OUTPUT()); /*free host memory*/ - meta::ForEach> freeMem; + meta::ForEach> freeMem; freeMem(mappedFrame); } log("openPMD: ( end ) load species: %1%") % speciesName; diff --git a/include/picongpu/plugins/output/WriteSpeciesCommon.hpp b/include/picongpu/plugins/output/WriteSpeciesCommon.hpp index 4c66612abff..4849020185f 100644 --- a/include/picongpu/plugins/output/WriteSpeciesCommon.hpp +++ b/include/picongpu/plugins/output/WriteSpeciesCommon.hpp @@ -124,11 +124,8 @@ namespace picongpu struct OperatorCreateVectorBox { template - struct apply - { - using type - = pmacc::meta::Pair::type::type>>; - }; + using fn + = pmacc::meta::Pair::type::type>>; }; } // namespace picongpu diff --git a/include/picongpu/plugins/particleCalorimeter/ParticleCalorimeter.hpp b/include/picongpu/plugins/particleCalorimeter/ParticleCalorimeter.hpp index 5e88af5ee16..378d18be701 100644 --- a/include/picongpu/plugins/particleCalorimeter/ParticleCalorimeter.hpp +++ b/include/picongpu/plugins/particleCalorimeter/ParticleCalorimeter.hpp @@ -440,7 +440,7 @@ namespace picongpu boost::program_options::options_description& desc, std::string const& masterPrefix = std::string{}) override { - meta::ForEach> getEligibleFilterNames; + meta::ForEach> getEligibleFilterNames; getEligibleFilterNames(allowedFilters); concatenatedFilterNames = plugins::misc::concatenateToString(allowedFilters, ", "); @@ -580,7 +580,7 @@ namespace picongpu endInternalCellsLocal, std::placeholders::_1); - meta::ForEach>{}( + meta::ForEach>{}( m_help->filter.get(m_id), currentStep, unaryKernel); @@ -646,7 +646,7 @@ namespace picongpu endExternalCellsLocal, std::placeholders::_1); - meta::ForEach>{}( + meta::ForEach>{}( m_help->filter.get(m_id), Environment<>::get().SimulationDescription().getCurrentStep(), unaryKernel); diff --git a/include/picongpu/simulation/control/Simulation.hpp b/include/picongpu/simulation/control/Simulation.hpp index d480d70ae6d..62b4c1208fe 100644 --- a/include/picongpu/simulation/control/Simulation.hpp +++ b/include/picongpu/simulation/control/Simulation.hpp @@ -79,7 +79,6 @@ #include #include -#include #include #include @@ -354,7 +353,8 @@ namespace picongpu #endif // Allocate and initialize particle species with all left-over memory below - meta::ForEach> createSpeciesMemory; + + meta::ForEach> createSpeciesMemory; createSpeciesMemory(deviceHeap, cellDescription.get()); size_t freeGpuMem = freeDeviceMemory(); @@ -394,7 +394,7 @@ namespace picongpu #endif - meta::ForEach> + meta::ForEach> logMemoryStatisticsForSpecies; logMemoryStatisticsForSpecies(deviceHeap); @@ -463,7 +463,7 @@ namespace picongpu else { initialiserController->init(); - meta::ForEach> initSpecies; + meta::ForEach> initSpecies; initSpecies(0); /* Remove all particles that are outside the respective boundaries * (this can happen if density functor didn't account for it). @@ -556,7 +556,7 @@ namespace picongpu void resetAll(uint32_t currentStep) override { resetFields(currentStep); - meta::ForEach> resetParticles; + meta::ForEach> resetParticles; resetParticles(currentStep); } @@ -569,7 +569,7 @@ namespace picongpu log("slide in step %1%") % currentStep; resetAll(currentStep); initialiserController->slide(currentStep); - meta::ForEach> initSpecies; + meta::ForEach> initSpecies; initSpecies(currentStep); } } diff --git a/include/picongpu/simulation/stage/CurrentDeposition.hpp b/include/picongpu/simulation/stage/CurrentDeposition.hpp index 085e8b7b198..bd9155953b5 100644 --- a/include/picongpu/simulation/stage/CurrentDeposition.hpp +++ b/include/picongpu/simulation/stage/CurrentDeposition.hpp @@ -74,7 +74,7 @@ namespace picongpu typename pmacc::particles::traits::FilterByFlag>::type; meta::ForEach< SpeciesWithCurrentSolver, - detail::CurrentDeposition>> + detail::CurrentDeposition>> depositCurrent; depositCurrent(step, fieldJ, dc); } diff --git a/include/picongpu/simulation/stage/IterationStart.hpp b/include/picongpu/simulation/stage/IterationStart.hpp index 32beee1b162..c7ff550c158 100644 --- a/include/picongpu/simulation/stage/IterationStart.hpp +++ b/include/picongpu/simulation/stage/IterationStart.hpp @@ -44,7 +44,7 @@ namespace picongpu */ void operator()(uint32_t const step) const { - meta::ForEach> callFunctors; + meta::ForEach> callFunctors; callFunctors(step); } }; diff --git a/include/picongpu/simulation/stage/ParticleBoundaries.hpp b/include/picongpu/simulation/stage/ParticleBoundaries.hpp index 3e6faea7867..21b27620531 100644 --- a/include/picongpu/simulation/stage/ParticleBoundaries.hpp +++ b/include/picongpu/simulation/stage/ParticleBoundaries.hpp @@ -231,7 +231,7 @@ namespace picongpu using SpeciesWithPusher = typename pmacc::particles::traits::FilterByFlag>::type; //! Functor to process all affected species - meta::ForEach> processSpecies; + meta::ForEach> processSpecies; }; } // namespace stage diff --git a/include/picongpu/simulation/stage/ParticleIonization.hpp b/include/picongpu/simulation/stage/ParticleIonization.hpp index 65f2a2f979a..e77401e6a5f 100644 --- a/include/picongpu/simulation/stage/ParticleIonization.hpp +++ b/include/picongpu/simulation/stage/ParticleIonization.hpp @@ -58,8 +58,7 @@ namespace picongpu { using pmacc::particles::traits::FilterByFlag; using SpeciesWithIonizers = typename FilterByFlag>::type; - pmacc::meta::ForEach> - particleIonization; + pmacc::meta::ForEach> particleIonization; particleIonization(cellDescription, step); } diff --git a/include/picongpu/simulation/stage/RuntimeDensityFile.hpp b/include/picongpu/simulation/stage/RuntimeDensityFile.hpp index 1fd6c9eea83..0441717dc19 100644 --- a/include/picongpu/simulation/stage/RuntimeDensityFile.hpp +++ b/include/picongpu/simulation/stage/RuntimeDensityFile.hpp @@ -116,7 +116,7 @@ namespace picongpu private: //! Functor to process all species - meta::ForEach> processSpecies; + meta::ForEach> processSpecies; }; } // namespace stage diff --git a/include/pmacc/functor/Call.hpp b/include/pmacc/functor/Call.hpp index 40a04efdf8f..92ef1b63d70 100644 --- a/include/pmacc/functor/Call.hpp +++ b/include/pmacc/functor/Call.hpp @@ -23,11 +23,8 @@ #include "pmacc/types.hpp" -#include - #include - namespace pmacc { namespace functor @@ -37,7 +34,7 @@ namespace pmacc * @tparam T_Functor stateless unary functor type, must be default-constructible and * operator() must take the current time step as the only parameter */ - template + template struct Call { //! Functor type diff --git a/include/pmacc/functor/Filtered.hpp b/include/pmacc/functor/Filtered.hpp index 87af554977d..d8d0928299b 100644 --- a/include/pmacc/functor/Filtered.hpp +++ b/include/pmacc/functor/Filtered.hpp @@ -95,13 +95,7 @@ namespace pmacc * A unary filters means that each argument can only pass the same filter * check before its results are combined. */ - template< - typename T_FilterOperator, - typename T_Filter, - typename T_Functor, - uint32_t T_numFunctorArguments - - > + template struct Filtered< T_FilterOperator, filter::Interface, @@ -109,14 +103,8 @@ namespace pmacc : private filter::Interface , Interface { - template - struct apply - { - using type = Filtered< - T_FilterOperator, - typename boost::mpl::apply::type, - typename boost::mpl::apply::type>; - }; + // template + // using fn = Filtered, Apply>; using Filter = filter::Interface; using Functor = Interface; diff --git a/include/pmacc/mappings/simulation/ResourceMonitor.tpp b/include/pmacc/mappings/simulation/ResourceMonitor.tpp index 41c932125cd..a54bc73ae76 100644 --- a/include/pmacc/mappings/simulation/ResourceMonitor.tpp +++ b/include/pmacc/mappings/simulation/ResourceMonitor.tpp @@ -70,7 +70,7 @@ namespace pmacc { using dim = std::integral_constant; std::vector particleCounts; - meta::ForEach> countParticles; + meta::ForEach> countParticles; countParticles(particleCounts, cellDescription, parFilter); return particleCounts; } diff --git a/include/pmacc/math/MapTuple.hpp b/include/pmacc/math/MapTuple.hpp index 055a2cc1567..610b75ca7a1 100644 --- a/include/pmacc/math/MapTuple.hpp +++ b/include/pmacc/math/MapTuple.hpp @@ -28,8 +28,6 @@ namespace pmacc { namespace math { - namespace bmpl = boost::mpl; - /** wrap a datum * * @tparam T_Pair mp_list< key, type of the value > diff --git a/include/pmacc/math/vector/compile-time/Vector.hpp b/include/pmacc/math/vector/compile-time/Vector.hpp index b77caaf7eac..c9d9d0a87c5 100644 --- a/include/pmacc/math/vector/compile-time/Vector.hpp +++ b/include/pmacc/math/vector/compile-time/Vector.hpp @@ -24,8 +24,6 @@ #include "pmacc/math/vector/Vector.hpp" #include "pmacc/types.hpp" -#include - #include namespace pmacc diff --git a/include/pmacc/meta/Apply.hpp b/include/pmacc/meta/Apply.hpp new file mode 100644 index 00000000000..456051dd9ee --- /dev/null +++ b/include/pmacc/meta/Apply.hpp @@ -0,0 +1,82 @@ +/* Copyright 2022 Bernhard Manfred Gruber + * + * This file is part of PMacc. + * + * PMacc is free software: you can redistribute it and/or modify + * it under the terms of either the GNU General Public License or + * the GNU Lesser General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * PMacc is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License and the GNU Lesser General Public License + * for more details. + * + * You should have received a copy of the GNU General Public License + * and the GNU Lesser General Public License along with PMacc. + * If not, see . + */ + +#pragma once + +#include "Mp11.hpp" + +namespace pmacc +{ + namespace detail + { + template + struct ReplacePlaceholdersImpl + { + using type = E; + }; + template + struct ReplacePlaceholdersImpl, Args...> + { + using type = mp_at_c, I>; + }; + + template typename E, typename... Ts, typename... Args> + struct ReplacePlaceholdersImpl, Args...> + { + using type = E::type...>; + // using type = typename E::type...>::type; // also calls + // nested ::type of E to mimic mpl::apply + }; + } // namespace detail + + template + using ReplacePlaceholders = typename detail::ReplacePlaceholdersImpl::type; + + namespace detail + { + template + inline constexpr bool isPlaceholderExpression = false; + + template + inline constexpr bool isPlaceholderExpression> = true; + + template typename L, typename... Ts> + inline constexpr bool isPlaceholderExpression> = (isPlaceholderExpression || ... || false); + + template> + struct ApplyImpl : Expression + { + }; + + template + struct ApplyImpl + { + template + using fn = ReplacePlaceholders; + }; + } // namespace detail + + /// Equivalent of boost::mpl::apply. If Expression contains placeholders (such as _1 etc.), the placeholders are + /// replaced by Args via pmacc::ReplacePlaceholders. If there are no placeholders, Expression is treated as a + /// quoted meta function and the Expression::fn is returned. + template + using Apply = typename detail::ApplyImpl::template fn; +} // namespace pmacc diff --git a/include/pmacc/meta/ForEach.hpp b/include/pmacc/meta/ForEach.hpp index eb70a610c23..2d2f072cf38 100644 --- a/include/pmacc/meta/ForEach.hpp +++ b/include/pmacc/meta/ForEach.hpp @@ -21,42 +21,36 @@ #pragma once -#include "pmacc/meta/accessors/Identity.hpp" - -#include +#include "Apply.hpp" +#include "Mp11.hpp" #include namespace pmacc::meta { - /** Compile-Time for each for Boost::MPL Type Lists + /** Compile-Time for each for type lists * * @tparam List An mp_list. * @tparam T_Functor An unary lambda functor with a HDINLINE void operator()(...) method - * _1 is substituted by Accessor's result using boost::mpl::apply with elements from T_MPLSeq. - * The maximum number of parameters for the operator() is limited by - * PMACC_MAX_FUNCTOR_OPERATOR_PARAMS + * _1 is substituted by Accessor's result using Apply with elements from List. * @tparam T_Accessor An unary lambda operation * * Example: * List = pmacc::mp_list * Functor = any unary lambda functor * Accessor = lambda operation identity - * - * definition: F(X) means boost::apply * * call: ForEach()(42); * unrolled code: Functor(Accessor(int))(42); * Functor(Accessor(float))(42); */ - template> + template> struct ForEach { - template - using ReplacePlaceholder = - typename boost::mpl::apply1::type>::type; + template + using MakeFunctor = Apply::type>; - using SolvedFunctors = mp_transform; + using SolvedFunctors = mp_transform; PMACC_NO_NVCC_HDWARNING template diff --git a/include/pmacc/meta/GetKeyFromAlias.hpp b/include/pmacc/meta/GetKeyFromAlias.hpp index b8420ec4ca6..8f74adc90ce 100644 --- a/include/pmacc/meta/GetKeyFromAlias.hpp +++ b/include/pmacc/meta/GetKeyFromAlias.hpp @@ -23,12 +23,9 @@ #include "pmacc/meta/conversion/SeqToMap.hpp" #include "pmacc/meta/conversion/TypeToAliasPair.hpp" -#include "pmacc/meta/conversion/TypeToPair.hpp" #include "pmacc/meta/errorHandlerPolicies/ReturnType.hpp" #include "pmacc/types.hpp" -#include - #include namespace pmacc @@ -44,26 +41,26 @@ namespace pmacc template> struct GetKeyFromAlias { - private: + public: using KeyNotFoundPolicy = T_KeyNotFoundPolicy; /*create a map where Key is a undeclared alias and value is real type*/ - using AliasMap = typename SeqToMap>::type; + using AliasMap = typename SeqToMap>::type; /*create a map where Key and value is real type*/ - using KeyMap = typename SeqToMap>::type; + using KeyMap = typename SeqToMap>::type; /*combine both maps*/ using FullMap = mp_fold; /* search for given key, * - we get the real type if key found - * - else we get boost::mpl::void_ + * - else we get void */ using MapType = mp_map_find; public: /* Check for KeyNotFound and calculate final type. (Uses lazy evaluation) */ using type = typename mp_if< - std::is_same, - boost::mpl::apply, - mp_defer>::type; + mp_map_contains, + mp_defer, + mp_defer>::type; }; } // namespace pmacc diff --git a/include/pmacc/meta/accessors/Identity.hpp b/include/pmacc/meta/accessors/Identity.hpp index 2efb641f82d..47c7014ae01 100644 --- a/include/pmacc/meta/accessors/Identity.hpp +++ b/include/pmacc/meta/accessors/Identity.hpp @@ -24,8 +24,6 @@ #include "pmacc/types.hpp" -#include - namespace pmacc { namespace meta @@ -37,12 +35,11 @@ namespace pmacc * @tparam T in type * */ - template + template struct Identity { using type = T; }; - } // namespace accessors } // namespace meta diff --git a/include/pmacc/meta/accessors/Type.hpp b/include/pmacc/meta/accessors/Type.hpp index b514beeff27..eb004164a21 100644 --- a/include/pmacc/meta/accessors/Type.hpp +++ b/include/pmacc/meta/accessors/Type.hpp @@ -23,9 +23,6 @@ #include "pmacc/types.hpp" -#include - - namespace pmacc { namespace meta @@ -38,7 +35,7 @@ namespace pmacc * * T must have defined ::type */ - template + template struct Type { using type = typename T::type; diff --git a/include/pmacc/meta/conversion/ApplyGuard.hpp b/include/pmacc/meta/conversion/ApplyGuard.hpp index 89b0542ed36..a387c073c61 100644 --- a/include/pmacc/meta/conversion/ApplyGuard.hpp +++ b/include/pmacc/meta/conversion/ApplyGuard.hpp @@ -51,10 +51,7 @@ namespace pmacc struct ApplyGuard { template - struct apply - { - using type = T_LockedType; - }; + using fn = T_LockedType; }; } // namespace pmacc diff --git a/include/pmacc/meta/conversion/OperateOnSeq.hpp b/include/pmacc/meta/conversion/OperateOnSeq.hpp index 281c4085149..1f293265d17 100644 --- a/include/pmacc/meta/conversion/OperateOnSeq.hpp +++ b/include/pmacc/meta/conversion/OperateOnSeq.hpp @@ -21,12 +21,11 @@ #pragma once +#include "pmacc/meta/Apply.hpp" #include "pmacc/meta/Mp11.hpp" #include "pmacc/meta/accessors/Identity.hpp" #include "pmacc/types.hpp" -#include - namespace pmacc { /** run an unary operator on each element of a sequence @@ -38,12 +37,13 @@ namespace pmacc * from the sequence is passed to T_UnaryOperator * @return ::type mp_list */ - template> + template struct OperateOnSeq { - template - using Op = - typename boost::mpl::apply1::type>::type; + static_assert(detail::isPlaceholderExpression); + + template + using Op = Apply>; using type = mp_transform; }; diff --git a/include/pmacc/meta/conversion/Seq.hpp b/include/pmacc/meta/conversion/Seq.hpp index 2b0c2b0116b..b0d996becd9 100644 --- a/include/pmacc/meta/conversion/Seq.hpp +++ b/include/pmacc/meta/conversion/Seq.hpp @@ -29,13 +29,13 @@ namespace pmacc namespace detail { template - struct ToSeq + struct ToSeqImpl { using type = mp_list; }; template - struct ToSeq> + struct ToSeqImpl> { using type = mp_list; }; @@ -44,7 +44,7 @@ namespace pmacc /** If T_Type is an mp_list, return it. Otherwise wrap it in an mp_list. */ template - using ToSeq = typename detail::ToSeq::type; + using ToSeq = typename detail::ToSeqImpl::type; /** Makes an mp_list from T_Args. If any type in T_Args is a list itself, it will be unwrapped. */ diff --git a/include/pmacc/meta/conversion/SeqToMap.hpp b/include/pmacc/meta/conversion/SeqToMap.hpp index 0cb8cd2d952..79616377102 100644 --- a/include/pmacc/meta/conversion/SeqToMap.hpp +++ b/include/pmacc/meta/conversion/SeqToMap.hpp @@ -21,30 +21,27 @@ #pragma once -#include "pmacc/meta/accessors/Identity.hpp" #include "pmacc/types.hpp" -#include - namespace pmacc { /** convert a list to a map * * @tparam T_List an mp_list. * @tparam T_UnaryOperator unary operator to translate type from the sequence - * to a mpl pair + * to a mp_list pair * @tparam T_Accessor An unary lambda operator which is used before the type * from the sequence is passed to T_UnaryOperator * @return ::type mpl map */ - template> + template struct SeqToMap { template - using Op = - typename boost::mpl::apply1::type>::type; + using Op = Apply>; + + using ListOfPairs = mp_transform; - using ListOfTuples = mp_transform; - using type = mp_fold, mp_map_insert>; + using type = mp_fold, mp_map_insert>; }; } // namespace pmacc diff --git a/include/pmacc/meta/conversion/TypeToAliasPair.hpp b/include/pmacc/meta/conversion/TypeToAliasPair.hpp index 948cd3ac796..9dc44bc81db 100644 --- a/include/pmacc/meta/conversion/TypeToAliasPair.hpp +++ b/include/pmacc/meta/conversion/TypeToAliasPair.hpp @@ -28,6 +28,23 @@ namespace pmacc { + namespace detail + { + template + struct TypeToAliasPairImpl + { + using type = TypeToPair; + }; + + /** specialisation if T_Type is a pmacc alias*/ + template class T_Alias, typename T_Type> + struct TypeToAliasPairImpl> + { + using type + = pmacc::meta::Pair, T_Alias>; + }; + } // namespace detail + /** create pmacc::meta::Pair * * If T_Type is a pmacc alias than first is set to anonym alias name @@ -38,18 +55,5 @@ namespace pmacc * @resturn ::type */ template - struct TypeToAliasPair - { - using type = typename TypeToPair::type; - }; - - /** specialisation if T_Type is a pmacc alias*/ - template class T_Alias, typename T_Type> - struct TypeToAliasPair> - { - using type - = pmacc::meta::Pair, T_Alias>; - }; - - + using TypeToAliasPair = typename detail::TypeToAliasPairImpl::type; } // namespace pmacc diff --git a/include/pmacc/meta/conversion/TypeToPair.hpp b/include/pmacc/meta/conversion/TypeToPair.hpp index ec1f964565d..5c901b685d8 100644 --- a/include/pmacc/meta/conversion/TypeToPair.hpp +++ b/include/pmacc/meta/conversion/TypeToPair.hpp @@ -32,10 +32,5 @@ namespace pmacc * @resturn ::type pmacc::meta::Pair where first and second is set to T_Type */ template - struct TypeToPair - { - using type = pmacc::meta::Pair; - }; - - + using TypeToPair = pmacc::meta::Pair; } // namespace pmacc diff --git a/include/pmacc/meta/errorHandlerPolicies/ReturnType.hpp b/include/pmacc/meta/errorHandlerPolicies/ReturnType.hpp index 2fdc3d08448..bf131fc9d4c 100644 --- a/include/pmacc/meta/errorHandlerPolicies/ReturnType.hpp +++ b/include/pmacc/meta/errorHandlerPolicies/ReturnType.hpp @@ -34,10 +34,7 @@ namespace pmacc struct ReturnType { template - struct apply - { - using type = T_ReturnType; - }; + using fn = T_ReturnType; }; } // namespace errorHandlerPolicies diff --git a/include/pmacc/meta/errorHandlerPolicies/ReturnValue.hpp b/include/pmacc/meta/errorHandlerPolicies/ReturnValue.hpp index d0c51a0a0c9..920dd5bcaaa 100644 --- a/include/pmacc/meta/errorHandlerPolicies/ReturnValue.hpp +++ b/include/pmacc/meta/errorHandlerPolicies/ReturnValue.hpp @@ -33,10 +33,7 @@ namespace pmacc struct ReturnValue { template - struct apply - { - using type = T_Value; - }; + using fn = T_Value; }; } // namespace errorHandlerPolicies diff --git a/include/pmacc/meta/errorHandlerPolicies/ThrowValueNotFound.hpp b/include/pmacc/meta/errorHandlerPolicies/ThrowValueNotFound.hpp index 50760d6a352..8db41a39649 100644 --- a/include/pmacc/meta/errorHandlerPolicies/ThrowValueNotFound.hpp +++ b/include/pmacc/meta/errorHandlerPolicies/ThrowValueNotFound.hpp @@ -34,7 +34,7 @@ namespace pmacc struct ThrowValueNotFound { template - struct apply + struct fn { /* The compiler is allowed to evaluate an expression that does not depend on a template parameter * even if the class is never instantiated. In that case static assert is always @@ -45,7 +45,6 @@ namespace pmacc * `sizeof(ANY_TYPE) != 0` is always true and defers the evaluation. */ PMACC_CASSERT_MSG_TYPE(value_not_found_in_seq, T_Value, false && (sizeof(T_MPLSeq) != 0)); - using type = boost::mpl::void_; }; }; diff --git a/include/pmacc/particles/ParticleDescription.hpp b/include/pmacc/particles/ParticleDescription.hpp index 2976a36c321..fb0d86db449 100644 --- a/include/pmacc/particles/ParticleDescription.hpp +++ b/include/pmacc/particles/ParticleDescription.hpp @@ -44,7 +44,7 @@ namespace pmacc * (e.g. calculate mass, gamma, ...) * (e.g. useSolverXY, calcRadiation, ...) * @tparam T_FrameExtensionList sequence or single class with frame extensions - * - extension must be an unary template class that supports boost::mpl::apply1<> + * - extension must be an unary template class that supports Apply<> * - type of the final frame is applied to each extension class * (this allows pointers and references to a frame itself) * - the final frame that uses ParticleDescription inherits from all diff --git a/include/pmacc/particles/memory/buffers/ParticlesBuffer.hpp b/include/pmacc/particles/memory/buffers/ParticlesBuffer.hpp index 545d6d3925b..457ef616e1b 100644 --- a/include/pmacc/particles/memory/buffers/ParticlesBuffer.hpp +++ b/include/pmacc/particles/memory/buffers/ParticlesBuffer.hpp @@ -50,13 +50,10 @@ namespace pmacc template struct OperatorCreatePairStaticArray { - template - struct apply - { - using type = meta::Pair< - X, - StaticArray::type::type, std::integral_constant>>; - }; + template + using fn = meta::Pair< + T, + StaticArray::type::type, std::integral_constant>>; }; } // namespace detail diff --git a/include/pmacc/particles/memory/dataTypes/ListPointer.hpp b/include/pmacc/particles/memory/dataTypes/ListPointer.hpp index e662b4a9725..b5a47ab49a0 100644 --- a/include/pmacc/particles/memory/dataTypes/ListPointer.hpp +++ b/include/pmacc/particles/memory/dataTypes/ListPointer.hpp @@ -27,13 +27,13 @@ namespace pmacc { - template + template struct PreviousFramePtr { PMACC_ALIGN(previousFrame, Pointer); }; - template + template struct NextFramePtr { PMACC_ALIGN(nextFrame, Pointer); diff --git a/include/pmacc/particles/memory/dataTypes/Particle.hpp b/include/pmacc/particles/memory/dataTypes/Particle.hpp index 22f65a3a9b9..2b0b7406e5b 100644 --- a/include/pmacc/particles/memory/dataTypes/Particle.hpp +++ b/include/pmacc/particles/memory/dataTypes/Particle.hpp @@ -37,8 +37,6 @@ #include "pmacc/traits/HasIdentifier.hpp" #include "pmacc/types.hpp" -#include - #include namespace pmacc @@ -226,11 +224,11 @@ namespace pmacc { using pmacc::meta::ForEach; /* assign attributes from src to dest*/ - ForEach> copy; + ForEach> copy; copy(dest, src); /* set all attributes which are not in src to their default value*/ - ForEach> setAttributeToDefault; + ForEach> setAttributeToDefault; setAttributeToDefault(dest); }; }; diff --git a/include/pmacc/particles/memory/frames/Frame.hpp b/include/pmacc/particles/memory/frames/Frame.hpp index 9e54e89b249..bf38c13d455 100644 --- a/include/pmacc/particles/memory/frames/Frame.hpp +++ b/include/pmacc/particles/memory/frames/Frame.hpp @@ -22,6 +22,7 @@ #pragma once #include "pmacc/math/MapTuple.hpp" +#include "pmacc/meta/Apply.hpp" #include "pmacc/meta/GetKeyFromAlias.hpp" #include "pmacc/meta/conversion/OperateOnSeq.hpp" #include "pmacc/meta/conversion/SeqToMap.hpp" @@ -34,8 +35,6 @@ #include "pmacc/traits/HasIdentifier.hpp" #include "pmacc/types.hpp" -#include - namespace pmacc { namespace pmath = pmacc::math; @@ -60,9 +59,9 @@ namespace pmacc typename SeqToMap::type> , public InheritLinearly>>::type>> + mp_transform_q< + mp_bind>, + typename T_ParticleDescription::FrameExtensionList>>> { using ParticleDescription = T_ParticleDescription; using Name = typename ParticleDescription::Name; diff --git a/include/pmacc/particles/meta/FindByNameOrType.hpp b/include/pmacc/particles/meta/FindByNameOrType.hpp index 814fe14658c..fbf07b99d77 100644 --- a/include/pmacc/particles/meta/FindByNameOrType.hpp +++ b/include/pmacc/particles/meta/FindByNameOrType.hpp @@ -21,11 +21,10 @@ #pragma once +#include "pmacc/meta/Apply.hpp" #include "pmacc/meta/errorHandlerPolicies/ThrowValueNotFound.hpp" #include "pmacc/traits/GetCTName.hpp" -#include - #include namespace pmacc @@ -63,7 +62,7 @@ namespace pmacc using type = typename mp_if< mp_empty, - boost::mpl::apply, + mp_defer, mp_defer>::type; }; diff --git a/include/pmacc/types.hpp b/include/pmacc/types.hpp index 8344eaa11f0..c665f73d0ec 100644 --- a/include/pmacc/types.hpp +++ b/include/pmacc/types.hpp @@ -50,6 +50,7 @@ #include "pmacc/dimensions/Definition.hpp" #include "pmacc/eventSystem/EventType.hpp" #include "pmacc/memory/Align.hpp" +#include "pmacc/meta/Apply.hpp" #include "pmacc/meta/Mp11.hpp" #include "pmacc/ppFunctions.hpp" #include "pmacc/type/Area.hpp" diff --git a/share/picongpu/tests/compileCombinedAttributes/include/picongpu/param/fileOutput.param b/share/picongpu/tests/compileCombinedAttributes/include/picongpu/param/fileOutput.param index b827b121f16..dc850cc8e0b 100644 --- a/share/picongpu/tests/compileCombinedAttributes/include/picongpu/param/fileOutput.param +++ b/share/picongpu/tests/compileCombinedAttributes/include/picongpu/param/fileOutput.param @@ -28,9 +28,6 @@ #include "picongpu/particles/particleToGrid/CombinedDerive.def" #include "picongpu/particles/particleToGrid/ComputeGridValuePerFrame.def" -#include - - namespace picongpu { /** FieldTmp output (calculated at runtime) *******************************