46 template<
class T,
unsigned Dim,
class A,
class Op>
58 ASSIGNMSG(msg <<
"Checking for compressibility of LField with domain = ");
71 bool compress = c1 && c2 && ( c3 || c4 );
84 ASSIGNMSG(msg <<
"Yes we CAN compress, so do so now ... ");
99 if (*lf.
begin() == tmpval)
105 ASSIGNMSG(msg <<
"LHS and RHS are compressed, doing assign, and ");
106 ASSIGNMSG(msg << *lf.
begin() <<
" == " <<tmpval<<
", so result = 1");
120 ASSIGNMSG(msg <<
"No we cannot compress, so make sure we're ");
121 ASSIGNMSG(msg <<
"uncompressed. Fill domain? " << !(c3&&c2) <<
endl);
147 return (*Expr::Child)(Expr::Value.Arg);
151 return Expr::Child.offset(i)(Expr::Value.Arg);
155 return Expr::Child.offset(i,j)(Expr::Value.Arg);
159 return Expr::Child.offset(i,j,k)(Expr::Value.Arg);
164 return (*Expr::Child)(Expr::Value.Arg);
168 return Expr::Child.offset(i)(Expr::Value.Arg);
172 return Expr::Child.offset(i,j)(Expr::Value.Arg);
176 return Expr::Child.offset(i,j,k)(Expr::Value.Arg);
180 return Expr::Child.unit_offset(i)(Expr::Value.Arg);
184 return Expr::Child.unit_offset(i,j)(Expr::Value.Arg);
188 return Expr::Child.unit_offset(i,j,k)(Expr::Value.Arg);
197 Expr::Child.rewind(d);
201 return Expr::Child.size(d);
205 return Expr::Child.done(d);
209 return Expr::Child.Stride(d);
229 template<
class T1,
unsigned Dim,
class RHS,
class OP>
245 int lhs_id =
a.getBareField().get_Id();
246 typename RHS::Wrapped& bb = b.PETE_unwrap();
250 ASSIGNMSG(msg <<
"Checking whether to fill GC's on RHS ..." <<
endl);
262 a.getBareField().setDirtyFlag();
267 bool needFinalCompressCheck =
false;
276 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": making lfield copy.");
285 if ( ! local_domain.
empty() )
297 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": plugbase on ");
301 ASSIGNMSG(msg <<
"For lf " << lfcount <<
" with owned domain ");
305 if (
a.getBareField().compressible() &&
308 ASSIGNMSG(msg <<
"compressed assign, changing ");
321 ExprT expr(lf->
begin(local_domain), bb);
331 ASSIGNMSG(msg <<
": doing extra post-compute ");
335 needFinalCompressCheck =
true;
341 ERRORMSG(
"All Fields in an expression must be aligned. ");
343 ERRORMSG(
"This error occurred while evaluating an expression ");
353 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": swapping lfield data.");
355 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": at beg, lfield=" << *lf);
357 (*la).second->swapData( *lf );
359 ASSIGNMSG(msg <<
"For lf " << lfcount <<
": at end, lfield=");
372 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
374 a.getBareField().fillGuardCellsIfNotDirty();
379 if (fillGC && needFinalCompressCheck) {
380 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
381 a.getBareField().Compress();
402 template<
class A,
class RHS,
class OP,
class Tag,
class TP>
411 ASSIGNMSG(msg <<
"Computing assignment to IBF[" << lhs.Child.getDomain());
414 enum {
Dim = A::Dim_u };
415 typedef typename A::return_type T1;
424 const NDIndex<Dim> &total_domain = lhs.Child.getDomain();
427 ASSIGNMSG(msg <<
"Checking whether to fill GC's on RHS ..." <<
endl);
442 bool needFinalCompressCheck =
false;
454 if (!local_domain.
empty())
467 ASSIGNMSG(msg <<
"For lf " << lo <<
": plugbase on ");
483 ASSIGNMSG(msg <<
"Compressed assign on ");
500 LHS(lhs.Value, lf->
begin(local_domain));
501 ExprT expr2(ilhs, rhs, op);
507 ASSIGNMSG(msg <<
"Doing extra post-compute ");
511 needFinalCompressCheck =
true;
517 ERRORMSG(
"All Fields in an expression must be aligned. ");
519 ERRORMSG(
"This error occurred while evaluating an expression ");
520 ERRORMSG(
"for an LField with domain ");
531 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
539 if (fillGC && needFinalCompressCheck) {
540 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
564 template<
class T1,
unsigned Dim,
class RHS,
class OP>
595 bool needFinalCompressCheck =
false;
605 ASSIGNMSG(msg <<
"For lf " << lfcount <<
" with domain ");
618 ExprT expr(lf.
begin(),bb,op);
628 ASSIGNMSG(msg <<
": doing extra post-compute ");
632 needFinalCompressCheck =
true;
644 ASSIGNMSG(msg <<
"Filling GC's at end if necessary ..." <<
endl);
646 a.fillGuardCellsIfNotDirty();
650 if (needFinalCompressCheck) {
651 ASSIGNMSG(msg <<
"Trying to compress BareField at end ..." <<
endl);
void assign(const IndexedBareField< T1, Dim, Dim > &aa, RHS b, OP op, ExprTag< true >, bool fillGC)
bool TryCompressLHS(LField< T, Dim > &lf, A &rhs, Op op, const NDIndex< Dim > &domain)
bool for_each(const BareFieldIterator< T, D > &p, SameFieldID s, C)
FillGCIfNecessaryTag< D, T1 > FillGCIfNecessary(const BareField< T1, D > &bf)
void PETE_apply(const OpPeriodic< T > &, T &a, const T &b)
PETE_Combiner< bool, OpOr > PETE_OrCombiner
PETE_Combiner< bool, OpAnd > PETE_AndCombiner
Inform & endl(Inform &inf)
constexpr double e
The value of.
NDIndex< Dim > intersect(const NDIndex< Dim > &) const
bool containsAllPoints(const NDIndex< Dim > &b) const
void fillGuardCellsIfNotDirty() const
const NDIndex< Dim > & getDomain() const
ac_id_larray::iterator iterator_if
bool compressible() const
bool IsCompressed() const
const NDIndex< Dim > & getOwned() const
bool TryCompress(bool baseOnPhysicalCells=false)
const iterator & begin() const
void Uncompress(bool fill_domain=true)
const NDIndex< Dim > & getDomain() const
PETE_Return_t & offset(int i, int j, int k)
PETE_Return_t & offset(int i)
int size(unsigned d) const
PETE_Return_t & offset(int i) const
int done(unsigned d) const
PETE_Return_t & operator*()
PETE_Return_t & offset(int i, int j) const
PETE_Return_t & operator*() const
PETE_Return_t & offset(int i, int j)
Expr::PETE_Return_t PETE_Return_t
PETE_Return_t & offset(int i, int j, int k) const
PETE_Return_t & unit_offset(int i)
ParensIterator(const Expr &e)
PETE_Return_t & unit_offset(int i, int j)
PETE_Return_t & unit_offset(int i, int j, int k)
WrappedExpr & PETE_unwrap()
static type apply(const T &t)
static bool noFieldCompression
static bool extraCompressChecks
static void abort(const char *=0)