Skip to content

Commit 954c09c

Browse files
bernhardmgruberpsychocoderHPC
authored andcommitted
Replace mpl::apply
1 parent 1326f6f commit 954c09c

File tree

85 files changed

+295
-369
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+295
-369
lines changed

include/picongpu/algorithms/ShiftCoordinateSystem.hpp

-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@
2323
#include <pmacc/meta/ForEach.hpp>
2424
#include <pmacc/types.hpp>
2525

26-
#include <boost/mpl/placeholders.hpp>
27-
2826
namespace picongpu
2927
{
3028
/** shift to new coordinate system

include/picongpu/fields/absorber/exponential/Exponential.kernel

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ namespace picongpu
158158

159159
using SimulationDimensions = pmacc::mp_iota<pmacc::mp_int<simDim>>;
160160

161-
meta::ForEach<SimulationDimensions, detail::AbsorbInOneDirection<boost::mpl::_1>>
161+
meta::ForEach<SimulationDimensions, detail::AbsorbInOneDirection<pmacc::_1>>
162162
absorbInAllDirections;
163163

164164
absorbInAllDirections(worker, field, thickness, absorberStrength, mapper, relExchangeDir);

include/picongpu/initialization/InitialiserController.hpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ namespace picongpu
9898
* Calculate omega_p for each given species and create a `picLog::PHYSICS`
9999
* log message
100100
*/
101-
template<typename T_Species = boost::mpl::_1>
101+
template<typename T_Species = pmacc::_1>
102102
struct LogOmegaP
103103
{
104104
void operator()()

include/picongpu/particles/InitFunctors.hpp

+9-12
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,13 @@
2828
#include "picongpu/particles/manipulators/manipulators.def"
2929

3030
#include <pmacc/Environment.hpp>
31+
#include <pmacc/meta/Apply.hpp>
3132
#include <pmacc/meta/conversion/TypeToPointerPair.hpp>
3233
#include <pmacc/particles/meta/FindByNameOrType.hpp>
3334
#include <pmacc/traits/GetFlagType.hpp>
3435
#include <pmacc/traits/HasFlag.hpp>
3536
#include <pmacc/traits/Resolve.hpp>
3637

37-
#include <boost/mpl/apply.hpp>
3838

3939
namespace picongpu
4040
{
@@ -85,18 +85,18 @@ namespace picongpu
8585
* @tparam T_SpeciesType type or name as PMACC_CSTRING of the used species,
8686
* see speciesDefinition.param
8787
*/
88-
template<typename T_DensityFunctor, typename T_PositionFunctor, typename T_SpeciesType = boost::mpl::_1>
88+
template<typename T_DensityFunctor, typename T_PositionFunctor, typename T_SpeciesType = pmacc::_1>
8989
struct CreateDensity
9090
{
9191
using SpeciesType = pmacc::particles::meta::FindByNameOrType_t<VectorAllSpecies, T_SpeciesType>;
9292
using FrameType = typename SpeciesType::FrameType;
9393

9494

95-
using UserDensityFunctor = typename boost::mpl::apply1<T_DensityFunctor, SpeciesType>::type;
95+
using UserDensityFunctor = pmacc::Apply<T_DensityFunctor, SpeciesType>;
9696
/* add interface for compile time interface validation*/
9797
using DensityFunctor = densityProfiles::IProfile<UserDensityFunctor>;
9898

99-
using UserPositionFunctor = typename boost::mpl::apply1<T_PositionFunctor, SpeciesType>::type;
99+
using UserPositionFunctor = pmacc::Apply<T_PositionFunctor, SpeciesType>;
100100
/* add interface for compile time interface validation*/
101101
using PositionFunctor = manipulators::IUnary<UserPositionFunctor>;
102102

@@ -137,7 +137,7 @@ namespace picongpu
137137
template<
138138
typename T_Manipulator,
139139
typename T_SrcSpeciesType,
140-
typename T_DestSpeciesType = boost::mpl::_1,
140+
typename T_DestSpeciesType = pmacc::_1,
141141
typename T_SrcFilter = filter::All>
142142
struct ManipulateDerive
143143
{
@@ -146,9 +146,9 @@ namespace picongpu
146146
using SrcSpeciesType = pmacc::particles::meta::FindByNameOrType_t<VectorAllSpecies, T_SrcSpeciesType>;
147147
using SrcFrameType = typename SrcSpeciesType::FrameType;
148148

149-
using DestFunctor = typename boost::mpl::apply1<T_Manipulator, DestSpeciesType>::type;
149+
using DestFunctor = pmacc::Apply<T_Manipulator, DestSpeciesType>;
150150

151-
using SrcFilter = typename boost::mpl::apply1<T_SrcFilter, SrcSpeciesType>::type;
151+
using SrcFilter = pmacc::Apply<T_SrcFilter, SrcSpeciesType>;
152152

153153
/* note: this is a FilteredManipulator with filter::All for
154154
* destination species, users can filter the destination directly via if's
@@ -184,10 +184,7 @@ namespace picongpu
184184
* @tparam T_Filter picongpu::particles::filter,
185185
* particle filter type to select source particles to derive
186186
*/
187-
template<
188-
typename T_SrcSpeciesType,
189-
typename T_DestSpeciesType = boost::mpl::_1,
190-
typename T_Filter = filter::All>
187+
template<typename T_SrcSpeciesType, typename T_DestSpeciesType = pmacc::_1, typename T_Filter = filter::All>
191188
struct Derive : ManipulateDerive<manipulators::generic::None, T_SrcSpeciesType, T_DestSpeciesType, T_Filter>
192189
{
193190
};
@@ -208,7 +205,7 @@ namespace picongpu
208205
* @tparam T_SpeciesType type or name as PMACC_CSTRING of the particle species
209206
* to fill gaps in memory
210207
*/
211-
template<typename T_SpeciesType = boost::mpl::_1>
208+
template<typename T_SpeciesType = pmacc::_1>
212209
struct FillAllGaps
213210
{
214211
using SpeciesType = pmacc::particles::meta::FindByNameOrType_t<VectorAllSpecies, T_SpeciesType>;

include/picongpu/particles/Manipulate.hpp

+7-10
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@
2929
#include <pmacc/particles/algorithm/CallForEach.hpp>
3030
#include <pmacc/particles/meta/FindByNameOrType.hpp>
3131

32-
#include <boost/mpl/placeholders.hpp>
33-
3432
#include <cstdint>
3533
#include <type_traits>
3634

@@ -48,8 +46,8 @@ namespace picongpu
4846
{
4947
private:
5048
using Species = pmacc::particles::meta::FindByNameOrType_t<VectorAllSpecies, T_Species>;
51-
using SpeciesFunctor = typename boost::mpl::apply1<T_Manipulator, Species>::type;
52-
using ParticleFilter = typename boost::mpl::apply1<T_Filter, Species>::type;
49+
using SpeciesFunctor = pmacc::Apply<T_Manipulator, Species>;
50+
using ParticleFilter = pmacc::Apply<T_Filter, Species>;
5351

5452
public:
5553
using type = manipulators::IUnary<SpeciesFunctor, ParticleFilter>;
@@ -76,12 +74,12 @@ namespace picongpu
7674
* @tparam T_Filter picongpu::particles::filter, particle filter type to
7775
* select particles in `T_Species` to manipulate
7876
* @tparam T_Area area to process particles in operator()(currentStep),
79-
* wrapped into std::integral_constant for boost::mpl::apply to work;
77+
* wrapped into std::integral_constant for meta programming to work;
8078
* does not affect operator()(currentStep, areaMapperFactory)
8179
*/
8280
template<
8381
typename T_Manipulator,
84-
typename T_Species = boost::mpl::_1,
82+
typename T_Species = pmacc::_1,
8583
typename T_Filter = filter::All,
8684
typename T_Area = std::integral_constant<uint32_t, CORE + BORDER>>
8785
struct Manipulate
@@ -99,7 +97,7 @@ namespace picongpu
9997
* workflow is as follows:
10098
* - select the species to manipulate, often by filtering VectorAllSpecies
10199
* - define a manipulator type; in case the manipulator has a species type
102-
* as a template parameter, use the boost::mpl::_1 placeholder instead
100+
* as a template parameter, use the pmacc::_1 placeholder instead
103101
* - define a filter type when necessary
104102
* - call manipulate()
105103
*
@@ -135,8 +133,7 @@ namespace picongpu
135133
inline void manipulate(uint32_t const currentStep)
136134
{
137135
using SpeciesSeq = pmacc::ToSeq<T_Species>;
138-
using Functor
139-
= Manipulate<T_Manipulator, boost::mpl::_1, T_Filter, std::integral_constant<uint32_t, T_area>>;
136+
using Functor = Manipulate<T_Manipulator, pmacc::_1, T_Filter, std::integral_constant<uint32_t, T_area>>;
140137
pmacc::meta::ForEach<SpeciesSeq, Functor> forEach;
141138
forEach(currentStep);
142139
}
@@ -156,7 +153,7 @@ namespace picongpu
156153
inline void manipulate(uint32_t const currentStep, T_AreaMapperFactory const& areaMapperFactory)
157154
{
158155
using SpeciesSeq = pmacc::ToSeq<T_Species>;
159-
using Functor = Manipulate<T_Manipulator, boost::mpl::_1, T_Filter>;
156+
using Functor = Manipulate<T_Manipulator, pmacc::_1, T_Filter>;
160157
pmacc::meta::ForEach<SpeciesSeq, Functor> forEach;
161158
forEach(currentStep, areaMapperFactory);
162159
}

include/picongpu/particles/ParticlesFunctors.hpp

+4-6
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ namespace picongpu
213213
/* push all species */
214214
using VectorSpeciesWithPusher =
215215
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, particlePusher<>>::type;
216-
meta::ForEach<VectorSpeciesWithPusher, PushSpecies<boost::mpl::_1>> pushSpecies;
216+
meta::ForEach<VectorSpeciesWithPusher, PushSpecies<pmacc::_1>> pushSpecies;
217217
pushSpecies(currentStep, eventInt, updateEventList);
218218

219219
/* join all push events */
@@ -223,8 +223,7 @@ namespace picongpu
223223
}
224224

225225
/* call communication for all species */
226-
meta::ForEach<VectorSpeciesWithPusher, particles::CommunicateSpecies<boost::mpl::_1>>
227-
communicateSpecies;
226+
meta::ForEach<VectorSpeciesWithPusher, particles::CommunicateSpecies<pmacc::_1>> communicateSpecies;
228227
communicateSpecies(updateEventList, commEventList);
229228

230229
/* join all communication events */
@@ -246,7 +245,7 @@ namespace picongpu
246245
{
247246
using VectorSpeciesWithPusher =
248247
typename pmacc::particles::traits::FilterByFlag<VectorAllSpecies, particlePusher<>>::type;
249-
meta::ForEach<VectorSpeciesWithPusher, RemoveOuterParticles<boost::mpl::_1>> removeOuterParticles;
248+
meta::ForEach<VectorSpeciesWithPusher, RemoveOuterParticles<pmacc::_1>> removeOuterParticles;
250249
removeOuterParticles(currentStep);
251250
}
252251
};
@@ -326,8 +325,7 @@ namespace picongpu
326325
using hasIonizers = typename HasFlag<FrameType, ionizers<>>::type;
327326
if(hasIonizers::value)
328327
{
329-
meta::ForEach<SelectIonizerList, CallIonizationScheme<SpeciesType, boost::mpl::_1>>
330-
particleIonization;
328+
meta::ForEach<SelectIonizerList, CallIonizationScheme<SpeciesType, pmacc::_1>> particleIonization;
331329
particleIonization(cellDesc, currentStep);
332330
}
333331
}

include/picongpu/particles/ParticlesInit.kernel

+1-2
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,7 @@ namespace picongpu
205205
using ParticleCleanedAttrList =
206206
typename ResolveAndRemoveFromSeq<ParticleAttrList, AttrToIgnore>::type;
207207

208-
meta::ForEach<ParticleCleanedAttrList, SetAttributeToDefault<boost::mpl::_1>>
209-
setToDefault;
208+
meta::ForEach<ParticleCleanedAttrList, SetAttributeToDefault<pmacc::_1>> setToDefault;
210209
setToDefault(particle);
211210
}
212211
particle[multiMask_] = 1;

include/picongpu/particles/collision/WithPeer.hpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@
2424
#include "picongpu/particles/collision/InterCollision.hpp"
2525
#include "picongpu/particles/collision/IntraCollision.hpp"
2626

27+
#include <pmacc/meta/Apply.hpp>
2728
#include <pmacc/particles/meta/FindByNameOrType.hpp>
2829

29-
#include <boost/mpl/apply.hpp>
30-
3130
#include <cstdio>
3231

3332

@@ -106,8 +105,7 @@ namespace picongpu
106105

107106
using PeerSpecies = pmacc::particles::meta::FindByNameOrType_t<VectorAllSpecies, T_PeerSpecies>;
108107

109-
using CollisionFunctor =
110-
typename boost::mpl::apply2<T_CollisionFunctor, BaseSpecies, PeerSpecies>::type;
108+
using CollisionFunctor = pmacc::Apply<T_CollisionFunctor, BaseSpecies, PeerSpecies>;
111109

112110
detail::WithPeer<CollisionFunctor, T_FilterPair, BaseSpecies, PeerSpecies, colliderId, pairId>{}(
113111
deviceHeap,

include/picongpu/particles/debyeLength/Check.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ namespace picongpu
9797
HINLINE std::uint32_t countElectronLikeSpecies()
9898
{
9999
Counter::value() = 0u;
100-
meta::ForEach<T_SpeciesSeq, ElectonLikeSpeciesCounter<boost::mpl::_1>> count;
100+
meta::ForEach<T_SpeciesSeq, ElectonLikeSpeciesCounter<pmacc::_1>> count;
101101
count();
102102
return Counter::value();
103103
}
@@ -203,7 +203,7 @@ namespace picongpu
203203
}
204204
else
205205
{
206-
meta::ForEach<AllSpeciesWithCurrent, detail::CheckDebyeLength<boost::mpl::_1>> checkDebyeLength;
206+
meta::ForEach<AllSpeciesWithCurrent, detail::CheckDebyeLength<pmacc::_1>> checkDebyeLength;
207207
checkDebyeLength(cellDescription, isPrinting);
208208
}
209209
}

include/picongpu/particles/densityProfiles/EveryNthCellImpl.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,7 @@ namespace picongpu
3737
using SkipCells = typename pmacc::math::CT::shrinkTo<OrgSkipCells, simDim>::type;
3838

3939
template<typename T_SpeciesType>
40-
struct apply
41-
{
42-
using type = EveryNthCellImpl<OrgSkipCells>;
43-
};
40+
using fn = EveryNthCellImpl;
4441

4542
HINLINE
4643
EveryNthCellImpl(uint32_t currentStep)

include/picongpu/particles/densityProfiles/FreeFormulaImpl.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ namespace picongpu
3535
using UserFunctor = particles::functor::User<T_UserFunctor>;
3636

3737
template<typename T_SpeciesType>
38-
struct apply
39-
{
40-
using type = FreeFormulaImpl<UserFunctor>;
41-
};
38+
using fn = FreeFormulaImpl<UserFunctor>;
4239

4340
HINLINE FreeFormulaImpl(uint32_t currentStep) : UserFunctor(currentStep)
4441
{

include/picongpu/particles/densityProfiles/FromOpenPMDImpl.hpp

+1-2
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,13 @@ namespace picongpu
305305
} // namespace detail
306306

307307
/** Wrapper to be used in density.param, compatible with other density definitions
308-
*
309-
* Hooks internal implementation in detail:: to boost::mpl::apply
310308
*
311309
* @tparam T_ParamClass parameter type
312310
*/
313311
template<typename T_ParamClass>
314312
struct FromOpenPMDImpl : public T_ParamClass
315313
{
314+
// TODO(bgruber): is this supposed to hook into MPL? I cannot find where this is used.
316315
template<typename T_SpeciesType>
317316
struct apply
318317
{

include/picongpu/particles/densityProfiles/GaussianCloudImpl.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ namespace picongpu
3434
using ParamClass = T_ParamClass;
3535

3636
template<typename T_SpeciesType>
37-
struct apply
38-
{
39-
using type = GaussianCloudImpl<ParamClass>;
40-
};
37+
using fn = GaussianCloudImpl;
4138

4239
HINLINE GaussianCloudImpl(uint32_t currentStep)
4340
{

include/picongpu/particles/densityProfiles/GaussianImpl.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ namespace picongpu
3434
using ParamClass = T_ParamClass;
3535

3636
template<typename T_SpeciesType>
37-
struct apply
38-
{
39-
using type = GaussianImpl<ParamClass>;
40-
};
37+
using fn = GaussianImpl;
4138

4239
HINLINE GaussianImpl(uint32_t currentStep)
4340
{

include/picongpu/particles/densityProfiles/HomogenousImpl.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,7 @@ namespace picongpu
2929
struct HomogenousImpl
3030
{
3131
template<typename T_SpeciesType>
32-
struct apply
33-
{
34-
using type = HomogenousImpl;
35-
};
32+
using fn = HomogenousImpl;
3633

3734
HINLINE HomogenousImpl(uint32_t currentStep)
3835
{

include/picongpu/particles/densityProfiles/LinearExponentialImpl.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,7 @@ namespace picongpu
3232
using ParamClass = T_ParamClass;
3333

3434
template<typename T_SpeciesType>
35-
struct apply
36-
{
37-
using type = LinearExponentialImpl<ParamClass>;
38-
};
35+
using fn = LinearExponentialImpl;
3936

4037
HINLINE LinearExponentialImpl(uint32_t currentStep)
4138
{

include/picongpu/particles/densityProfiles/SphereFlanksImpl.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,7 @@ namespace picongpu
3333
using ParamClass = T_ParamClass;
3434

3535
template<typename T_SpeciesType>
36-
struct apply
37-
{
38-
using type = SphereFlanksImpl<ParamClass>;
39-
};
36+
using fn = SphereFlanksImpl;
4037

4138
HINLINE SphereFlanksImpl(uint32_t currentStep)
4239
{

include/picongpu/particles/filter/All.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,7 @@ namespace picongpu
5454
struct All
5555
{
5656
template<typename T_SpeciesType>
57-
struct apply
58-
{
59-
using type = All;
60-
};
57+
using fn = All;
6158

6259
/** create filter for the accelerator
6360
*

include/picongpu/particles/filter/RelativeGlobalDomainPosition.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,7 @@ namespace picongpu
102102
using Params = T_Params;
103103

104104
template<typename T_SpeciesType>
105-
struct apply
106-
{
107-
using type = RelativeGlobalDomainPosition;
108-
};
105+
using fn = RelativeGlobalDomainPosition;
109106

110107
HINLINE RelativeGlobalDomainPosition()
111108
{

include/picongpu/particles/filter/generic/Free.hpp

+1-4
Original file line numberDiff line numberDiff line change
@@ -74,10 +74,7 @@ namespace picongpu
7474
using Functor = functor::User<T_Functor>;
7575

7676
template<typename T_SpeciesType>
77-
struct apply
78-
{
79-
using type = Free;
80-
};
77+
using fn = Free;
8178

8279
/** constructor
8380
*

0 commit comments

Comments
 (0)