OPAL (Object Oriented Parallel Accelerator Library)
2021.1.99
OPAL
src
ippl
src
Utility
RNGAssignDefs.h
Go to the documentation of this file.
1
// -*- C++ -*-
2
/***************************************************************************
3
*
4
* The IPPL Framework
5
*
6
*
7
* Visit http://people.web.psi.ch/adelmann/ for more details
8
*
9
***************************************************************************/
10
11
#ifndef RNG_ASSIGN_DEFS_H
12
#define RNG_ASSIGN_DEFS_H
13
14
// include files
15
#include "
PETE/IpplExpressions.h
"
16
#include "
Field/AssignTags.h
"
17
18
19
// interactions for basic tags
20
22
//
23
// Evaluation functor.
24
//
26
27
template
<
class
GT>
28
inline
typename
SequenceGen<GT>::Return_t
29
for_each
(
const
SequenceGen<GT>
& p,
EvalFunctor_0
)
30
{
31
return
p();
32
}
33
35
//
36
// Count the elements in an expression.
37
//
39
40
template
<
class
GT,
class
C>
41
inline
int
42
for_each
(
const
SequenceGen<GT>
&,
PETE_CountElems
, C)
43
{
44
// just return a code value
45
return
-1;
46
}
47
49
//
50
// Increment the pointers in an expression.
51
//
53
54
template
<
class
GT,
class
C>
55
inline
int
56
for_each
(
const
SequenceGen<GT>
&,
PETE_Increment
, C)
57
{
58
// just return (increment happens automatically after evaluation!)
59
return
0;
60
}
61
62
63
// Field-specific tag interactions
64
65
67
//
68
// Go to beginning of LField
69
//
71
72
template
<
class
GT,
class
C>
73
inline
int
74
for_each
(
const
SequenceGen<GT>
&,
BeginLField
, C)
75
{
76
// just return
77
return
0;
78
}
79
81
//
82
// Go on to the next LField
83
//
85
86
template
<
class
GT,
class
C>
87
inline
int
88
for_each
(
const
SequenceGen<GT>
&,
NextLField
, C)
89
{
90
// just return
91
return
0;
92
}
93
94
//
95
// If there is an RNG in the expr, it can't have the same ID.
96
//
97
template
<
class
GT,
class
C>
98
inline
bool
99
for_each
(
const
SequenceGen<GT>
&,
SameFieldID
, C)
100
{
101
return
false
;
102
}
103
104
//
105
// for plugbase, just return true for RNG
106
//
107
template
<
unsigned
D>
struct
PlugBase
;
108
109
template
<
class
GT,
class
C,
unsigned
D>
110
inline
bool
111
for_each
(
const
SequenceGen<GT>
&,
const
PlugBase<D>
&, C)
112
{
113
return
true
;
114
}
115
116
//
117
// RNG objects are not compressed!
118
//
119
template
<
class
GT,
class
C>
120
inline
bool
121
for_each
(
const
SequenceGen<GT>
&,
IsCompressed
, C)
122
{
123
return
false
;
124
}
125
127
//
128
// Evaluation functors with arguments
129
//
131
132
template
<
class
GT>
133
inline
typename
SequenceGen<GT>::Return_t
134
for_each
(
const
SequenceGen<GT>
& p,
const
EvalFunctor_1
&)
135
{
136
return
p();
137
}
138
139
template
<
class
GT>
140
inline
typename
SequenceGen<GT>::Return_t
141
for_each
(
const
SequenceGen<GT>
& p,
const
EvalFunctor_2
&)
142
{
143
return
p();
144
}
145
146
template
<
class
GT>
147
inline
typename
SequenceGen<GT>::Return_t
148
for_each
(
const
SequenceGen<GT>
& p,
const
EvalFunctor_3
&)
149
{
150
return
p();
151
}
152
153
//
154
// Does it have unit stride?
155
// Not really a sensible question, but it is safe to say it does.
156
//
157
158
template
<
class
GT,
class
C>
159
inline
bool
160
for_each
(
const
SequenceGen<GT>
&
/*p*/
,
HasUnitStride
, C)
161
{
162
return
true
;
163
}
164
165
//
166
// RNG ignores step functor
167
//
168
template
<
class
GT,
class
C>
169
inline
int
170
for_each
(
const
SequenceGen<GT>
&,
StepFunctor
, C)
171
{
172
return
0;
173
}
174
175
//
176
// RNG ignores rewind functor
177
//
178
template
<
class
GT,
class
C>
179
inline
int
180
for_each
(
const
SequenceGen<GT>
&,
RewindFunctor
, C)
181
{
182
return
0;
183
}
184
185
// RNG ignores filling guard cells question
186
template
<
class
GT,
class
C,
unsigned
int
D,
class
T1>
187
inline
int
188
for_each
(
const
SequenceGen<GT>
&,
189
const
FillGCIfNecessaryTag<D,T1>
&, C)
190
{
191
return
0;
192
}
193
194
195
#endif
// RNG_ASSIGN_DEFS_H
196
197
/***************************************************************************
198
* $RCSfile: RNGAssignDefs.h,v $ $Author: adelmann $
199
* $Revision: 1.1.1.1 $ $Date: 2003/01/23 07:40:33 $
200
* IPPL_VERSION_ID: $Id: RNGAssignDefs.h,v 1.1.1.1 2003/01/23 07:40:33 adelmann Exp $
201
***************************************************************************/
202
AssignTags.h
IpplExpressions.h
for_each
SequenceGen< GT >::Return_t for_each(const SequenceGen< GT > &p, EvalFunctor_0)
Definition:
RNGAssignDefs.h:29
PlugBase
Definition:
AssignDefs.h:70
SameFieldID
Definition:
AssignTags.h:24
IsCompressed
Definition:
AssignTags.h:32
EvalFunctor_1
Definition:
AssignTags.h:38
EvalFunctor_2
Definition:
AssignTags.h:49
EvalFunctor_3
Definition:
AssignTags.h:60
BeginLField
Definition:
AssignTags.h:74
NextLField
Definition:
AssignTags.h:82
StepFunctor
Definition:
AssignTags.h:88
RewindFunctor
Definition:
AssignTags.h:95
HasUnitStride
Definition:
AssignTags.h:107
FillGCIfNecessaryTag
Definition:
AssignTags.h:115
EvalFunctor_0
Definition:
PETE.h:179
PETE_Increment
Definition:
PETE.h:185
PETE_CountElems
Definition:
PETE.h:192
SequenceGen
Definition:
SequenceGen.h:76
SequenceGen::Return_t
GT::Return_t Return_t
Definition:
SequenceGen.h:89
Generated on Wed Aug 25 2021 16:41:00 for OPAL (Object Oriented Parallel Accelerator Library) by
1.9.1