OPAL (Object Oriented Parallel Accelerator Library)
2024.1
OPAL
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
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
PETE_CountElems
Definition:
PETE.h:191
SequenceGen
Definition:
SequenceGen.h:75
NextLField
Definition:
AssignTags.h:81
EvalFunctor_1
Definition:
AssignTags.h:37
SameFieldID
Definition:
AssignTags.h:23
SequenceGen::Return_t
GT::Return_t Return_t
Definition:
SequenceGen.h:89
PlugBase
Definition:
AssignDefs.h:69
PETE_Increment
Definition:
PETE.h:184
EvalFunctor_0
Definition:
PETE.h:178
EvalFunctor_3
Definition:
AssignTags.h:59
FillGCIfNecessaryTag
Definition:
AssignTags.h:114
RewindFunctor
Definition:
AssignTags.h:94
BeginLField
Definition:
AssignTags.h:73
HasUnitStride
Definition:
AssignTags.h:106
IsCompressed
Definition:
AssignTags.h:31
for_each
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
Definition:
AssignDefs.h:30
StepFunctor
Definition:
AssignTags.h:87
IpplExpressions.h
EvalFunctor_2
Definition:
AssignTags.h:48
AssignTags.h
Generated on Tue Jul 2 2024 15:05:16 for OPAL (Object Oriented Parallel Accelerator Library) by
1.8.5