Block-Structured AMR Software Framework
Loading...
Searching...
No Matches
AMReX_FArrayBox.H
Go to the documentation of this file.
1
2#ifndef BL_FARRAYBOX_H
3#define BL_FARRAYBOX_H
4#include <AMReX_Config.H>
5
6#include <AMReX_BaseFab.H>
7#include <AMReX_FabConv.H>
8#include <AMReX_FabFactory.H>
9
10namespace amrex {
11
12class FArrayBox;
13
29class FABio // NOLINT(cppcoreguidelines-special-member-functions)
30{
31public:
40 {
43 };
66 enum Format
67 {
71 //
72 // This is set to four so that when reading in an old FAB,
73 // we don't get confused when we see an old FAB_8BITRLE file.
74 //
78 };
93
95 virtual ~FABio () = default;
101 virtual void read (std::istream& is,
102 FArrayBox& fb) const = 0;
110 virtual void write (std::ostream& os,
111 const FArrayBox& fb,
112 int comp,
113 int num_comp) const = 0;
120 virtual void skip (std::istream& is,
121 FArrayBox& f) const = 0;
122
123 virtual void skip (std::istream& is,
124 FArrayBox& f,
125 int nCompToSkip) const = 0;
130 virtual void write_header (std::ostream& os,
131 const FArrayBox& f,
132 int nvar) const;
144 static FABio* read_header (std::istream& is,
145 FArrayBox& f);
146
152 static FABio* read_header (std::istream& is,
153 FArrayBox& f,
154 int compIndex,
155 int& nCompAvailable);
156};
157
158//
159// Our binary FABio type.
160//
162 :
163 public FABio
164{
165public:
167
168 void read (std::istream& is,
169 FArrayBox& fb) const override;
170
171 void write (std::ostream& os,
172 const FArrayBox& fb,
173 int comp,
174 int num_comp) const override;
175
176 void skip (std::istream& is,
177 FArrayBox& f) const override;
178
179 void skip (std::istream& is,
180 FArrayBox& f,
181 int nCompToSkip) const override;
182
183private:
184 void write_header (std::ostream& os,
185 const FArrayBox& f,
186 int nvar) const override;
187
188 std::unique_ptr<RealDescriptor> realDesc;
189};
190
229 :
230 public BaseFab<Real>
231{
233 friend class FABio;
234public:
236 FArrayBox () noexcept = default;
237
238 explicit FArrayBox (Arena* ar) noexcept;
239
240 FArrayBox (const Box& b, int ncomp, Arena* ar);
241
247 explicit FArrayBox (const Box& b,
248 int ncomp=1,
249 bool alloc=true,
250 bool shared=false,
251 Arena* ar = nullptr);
252
253 FArrayBox (const FArrayBox& rhs, MakeType make_type, int scomp, int ncomp);
254
255 FArrayBox (const Box& b, int ncomp, Real const* p) noexcept;
256
257 FArrayBox (const Box& b, int ncomp, Real* p) noexcept;
258
259 explicit FArrayBox (Array4<Real> const& a) noexcept : BaseFab<Real>(a) {}
260
261 FArrayBox (Array4<Real> const& a, IndexType t) noexcept : BaseFab<Real>(a,t) {}
262
263 explicit FArrayBox (Array4<Real const> const& a) noexcept : BaseFab<Real>(a) {}
264
265 explicit FArrayBox (Array4<Real const> const& a, IndexType t) noexcept : BaseFab<Real>(a,t) {}
266
268 ~FArrayBox () noexcept override = default;
269
270 FArrayBox (FArrayBox&& rhs) noexcept = default;
271 FArrayBox& operator= (FArrayBox&&) noexcept = default;
272
273 FArrayBox (const FArrayBox&) = delete;
274 FArrayBox& operator= (const FArrayBox&) = delete;
275
277 template <RunOn run_on AMREX_DEFAULT_RUNON>
278 FArrayBox& operator= (Real v) noexcept;
279
285 template <RunOn run_on AMREX_DEFAULT_RUNON>
286 [[nodiscard]] bool contains_nan () const noexcept;
287
288 template <RunOn run_on AMREX_DEFAULT_RUNON>
289 [[nodiscard]] bool contains_nan (const Box& bx, int scomp, int ncomp) const noexcept;
294 template <RunOn run_on AMREX_DEFAULT_RUNON>
295 bool contains_nan (IntVect& where) const noexcept;
296
297 template <RunOn run_on AMREX_DEFAULT_RUNON>
298 bool contains_nan (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept;
304 template <RunOn run_on AMREX_DEFAULT_RUNON>
305 [[nodiscard]] bool contains_inf () const noexcept;
306
307 template <RunOn run_on AMREX_DEFAULT_RUNON>
308 [[nodiscard]] bool contains_inf (const Box& bx, int scomp, int ncomp) const noexcept;
313 template <RunOn run_on AMREX_DEFAULT_RUNON>
314 bool contains_inf (IntVect& where) const noexcept;
315
316 template <RunOn run_on AMREX_DEFAULT_RUNON>
317 bool contains_inf (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept;
318
320 void resize (const Box& b, int N = 1, Arena* ar = nullptr);
321
322 [[nodiscard]] FabType getType () const noexcept { return m_type; }
323
324 void initVal () noexcept; // public for cuda
325
327 friend std::ostream& operator<< (std::ostream& os, const FArrayBox& fb);
329 friend std::istream& operator>> (std::istream& is, FArrayBox& fb);
334 void writeOn (std::ostream& os) const;
335
347 void writeOn (std::ostream& os,
348 int comp,
349 int num_comp=1) const;
350
352 void readFrom (std::istream& is);
353
360 int readFrom (std::istream& is, int compIndex);
361
367 static Box skipFAB (std::istream& is,
368 int& num_comp);
369
371 static void skipFAB (std::istream& is);
372
380 static void setFormat (FABio::Format fmt);
381
383 static FABio::Format getFormat ();
384
396 static void setOrdering (FABio::Ordering ordering);
397
403 static FABio::Ordering getOrdering ();
404
409 static void setPrecision (FABio::Precision precision);
410
416 static FABio::Precision getPrecision ();
417
419 static const FABio& getFABio ();
420
425 static void setFABio (FABio* rd);
426
427 static std::unique_ptr<RealDescriptor> getDataDescriptor ();
428
429 static std::string getClassName ();
430
431 static bool set_do_initval (bool tf);
432 static bool get_do_initval ();
433 static Real set_initval (Real iv);
434 static Real get_initval ();
436 static void Initialize ();
437 static void Finalize ();
438 static bool initialized;
439
440protected:
441
443
448 static FABio::Format format;
449 static FABio::Ordering ordering;
450
452 static FABio* fabio;
453
455 static bool do_initval;
456 static Real initval;
457 static bool init_snan;
458};
459
461
462template <RunOn run_on>
464FArrayBox::operator= (Real v) noexcept
465{
466 BaseFab<Real>::operator=<run_on>(v);
467 return *this;
468}
469
470template <RunOn run_on>
471bool
472FArrayBox::contains_nan () const noexcept
473{
474 const Real* dp = dptr;
475 const Long n = numPts()*nvar;
476#ifdef AMREX_USE_GPU
477 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
479 ReduceData<int> reduce_data(reduce_op);
480 using ReduceTuple = ReduceData<int>::Type;
481 reduce_op.eval(n, reduce_data,
482 [=] AMREX_GPU_DEVICE (Long i) -> ReduceTuple
483 {
484 return { static_cast<int>(amrex::isnan(dp[i])) };
485 });
486 ReduceTuple hv = reduce_data.value(reduce_op);
487 return amrex::get<0>(hv);
488 } else
489#endif
490 {
491 for (Long i = 0; i < n; i++) {
492 if (amrex::isnan(*dp++)) {
493 return true;
494 }
495 }
496 return false;
497 }
498}
499
500template <RunOn run_on>
501bool
502FArrayBox::contains_nan (const Box& bx, int scomp, int ncomp) const noexcept
503{
504 BL_ASSERT(scomp >= 0);
505 BL_ASSERT(ncomp >= 1);
506 BL_ASSERT(scomp < nComp());
507 BL_ASSERT(ncomp <= nComp());
509
510 const auto& a = this->array();
511
512#ifdef AMREX_USE_GPU
513 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
515 ReduceData<int> reduce_data(reduce_op);
516 using ReduceTuple = ReduceData<int>::Type;
517 reduce_op.eval(bx, reduce_data,
518 [=] AMREX_GPU_DEVICE (int i, int j, int k) -> ReduceTuple
519 {
520 bool t = false;
521 for (int n = scomp; n < scomp+ncomp; ++n) {
522 t = t || amrex::isnan(a(i,j,k,n));
523 }
524 return { static_cast<int>(t) };
525 });
526 ReduceTuple hv = reduce_data.value(reduce_op);
527 return amrex::get<0>(hv);
528 } else
529#endif
530 {
531 for (int n = scomp; n < scomp+ncomp; ++n) {
532 for (IntVect iv : bx.iterator()) {
533 if (amrex::isnan(a(iv, n))) {
534 return true;
535 }
536 }
537 }
538 return false;
539 }
540}
541
542template <RunOn run_on>
543bool
544FArrayBox::contains_nan (IntVect& where) const noexcept
545{
546 return contains_nan<run_on>(domain, 0, nComp(), where);
547}
548
549template <RunOn run_on>
550bool
551FArrayBox::contains_nan (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept
552{
553 BL_ASSERT(scomp >= 0);
554 BL_ASSERT(ncomp >= 1);
555 BL_ASSERT(scomp < nComp());
556 BL_ASSERT(ncomp <= nComp());
558
559 const auto& a = this->array();
560#ifdef AMREX_USE_GPU
561 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
562 Array<int,1+AMREX_SPACEDIM> ha{0,AMREX_D_DECL(std::numeric_limits<int>::lowest(),
563 std::numeric_limits<int>::lowest(),
564 std::numeric_limits<int>::lowest())};
565 Gpu::DeviceVector<int> dv(1+AMREX_SPACEDIM);
566 int* p = dv.data();
567 Gpu::htod_memcpy_async(p, ha.data(), sizeof(int)*ha.size());
568 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
569 {
570 int* flag = p;
571 bool t = false;
572 for (int n = scomp; n < scomp+ncomp; ++n) {
573 t = t || amrex::isnan(a(i,j,k,n));
574 }
575 if (t && (*flag == 0)) {
576 if (Gpu::Atomic::Exch(flag,1) == 0) {
577 AMREX_D_TERM(p[1] = i;,
578 p[2] = j;,
579 p[3] = k;);
580 }
581 }
582 });
583 Gpu::dtoh_memcpy_async(ha.data(), p, sizeof(int)*ha.size());
585 where = IntVect(AMREX_D_DECL(ha[1],ha[2],ha[3]));
586 return ha[0];
587 } else
588#endif
589 {
590 for (int n = scomp; n < scomp+ncomp; ++n) {
591 for (IntVect iv : bx.iterator()) {
592 if (amrex::isnan(a(iv, n))) {
593 where = iv;
594 return true;
595 }
596 }
597 }
598 return false;
599 }
600}
601
602template <RunOn run_on>
603bool
604FArrayBox::contains_inf () const noexcept
605{
606 const Real* dp = dptr;
607 const Long n = numPts()*nvar;
608#ifdef AMREX_USE_GPU
609 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
611 ReduceData<int> reduce_data(reduce_op);
612 using ReduceTuple = ReduceData<int>::Type;
613 reduce_op.eval(n, reduce_data,
614 [=] AMREX_GPU_DEVICE (Long i) -> ReduceTuple
615 {
616 return { static_cast<int>(amrex::isinf(dp[i])) };
617 });
618 ReduceTuple hv = reduce_data.value(reduce_op);
619 return amrex::get<0>(hv);
620 } else
621#endif
622 {
623 for (Long i = 0; i < n; i++) {
624 if (amrex::isinf(*dp++)) {
625 return true;
626 }
627 }
628 return false;
629 }
630}
631
632template <RunOn run_on>
633bool
634FArrayBox::contains_inf (const Box& bx, int scomp, int ncomp) const noexcept
635{
636 BL_ASSERT(scomp >= 0);
637 BL_ASSERT(ncomp >= 1);
638 BL_ASSERT(scomp < nComp());
639 BL_ASSERT(ncomp <= nComp());
641
642 const auto& a = this->array();
643
644#ifdef AMREX_USE_GPU
645 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
647 ReduceData<int> reduce_data(reduce_op);
648 using ReduceTuple = ReduceData<int>::Type;
649 reduce_op.eval(bx, reduce_data,
650 [=] AMREX_GPU_DEVICE (int i, int j, int k) ->ReduceTuple
651 {
652 bool t = false;
653 for (int n = scomp; n < scomp+ncomp; ++n) {
654 t = t || amrex::isinf(a(i,j,k,n));
655 }
656 return { static_cast<int>(t) };
657 });
658 ReduceTuple hv = reduce_data.value(reduce_op);
659 return amrex::get<0>(hv);
660 } else
661#endif
662 {
663 for (int n = scomp; n < scomp+ncomp; ++n) {
664 for (IntVect iv : bx.iterator()) {
665 if (amrex::isinf(a(iv, n))) {
666 return true;
667 }
668 }
669 }
670 return false;
671 }
672}
673
674template <RunOn run_on>
675bool
676FArrayBox::contains_inf (IntVect& where) const noexcept
677{
678 return contains_inf<run_on>(domain,0,nComp(),where);
679}
680
681template <RunOn run_on>
682bool
683FArrayBox::contains_inf (const Box& bx, int scomp, int ncomp, IntVect& where) const noexcept
684{
685 BL_ASSERT(scomp >= 0);
686 BL_ASSERT(ncomp >= 1);
687 BL_ASSERT(scomp < nComp());
688 BL_ASSERT(ncomp <= nComp());
690
691 const auto& a = this->array();
692#ifdef AMREX_USE_GPU
693 if (run_on == RunOn::Device && Gpu::inLaunchRegion()) {
694 Array<int,1+AMREX_SPACEDIM> ha{0,AMREX_D_DECL(std::numeric_limits<int>::lowest(),
695 std::numeric_limits<int>::lowest(),
696 std::numeric_limits<int>::lowest())};
697 Gpu::DeviceVector<int> dv(1+AMREX_SPACEDIM);
698 int* p = dv.data();
699 Gpu::htod_memcpy_async(p, ha.data(), sizeof(int)*ha.size());
700 amrex::ParallelFor(bx, [=] AMREX_GPU_DEVICE (int i, int j, int k) noexcept
701 {
702 int* flag = p;
703 bool t = false;
704 for (int n = scomp; n < scomp+ncomp; ++n) {
705 t = t || amrex::isinf(a(i,j,k,n));
706 }
707 if (t && (*flag == 0)) {
708 if (Gpu::Atomic::Exch(flag,1) == 0) {
709 AMREX_D_TERM(p[1] = i;,
710 p[2] = j;,
711 p[3] = k;);
712 }
713 }
714 });
715 Gpu::dtoh_memcpy_async(ha.data(), p, sizeof(int)*ha.size());
717 where = IntVect(AMREX_D_DECL(ha[1],ha[2],ha[3]));
718 return ha[0];
719 } else
720#endif
721 {
722 for (int n = scomp; n < scomp+ncomp; ++n) {
723 for (IntVect iv : bx.iterator()) {
724 if (amrex::isinf(a(iv, n))) {
725 where = iv;
726 return true;
727 }
728 }
729 }
730 return false;
731 }
732}
733
734}
735
736#endif /*BL_FARRAYBOX_H*/
#define BL_ASSERT(EX)
Definition AMReX_BLassert.H:39
#define AMREX_DEFAULT_RUNON
Definition AMReX_GpuControl.H:73
#define AMREX_GPU_DEVICE
Definition AMReX_GpuQualifiers.H:18
#define AMREX_D_TERM(a, b, c)
Definition AMReX_SPACE.H:172
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
A virtual base class for objects that manage their own dynamic memory allocation.
Definition AMReX_Arena.H:124
A FortranArrayBox(FAB)-like object.
Definition AMReX_BaseFab.H:189
Array4< Real const > array() const noexcept
Definition AMReX_BaseFab.H:381
Box domain
My index space.
Definition AMReX_BaseFab.H:1164
Real * dptr
The data pointer.
Definition AMReX_BaseFab.H:1163
int nvar
Number components.
Definition AMReX_BaseFab.H:1165
Long numPts() const noexcept
Returns the number of points.
Definition AMReX_BaseFab.H:287
int nComp() const noexcept
Returns the number of components.
Definition AMReX_BaseFab.H:279
__host__ __device__ bool contains(const IntVectND< dim > &p) const noexcept
Return true if argument is contained within BoxND.
Definition AMReX_Box.H:212
Definition AMReX_FabFactory.H:76
Definition AMReX_FArrayBox.H:164
void read(std::istream &is, FArrayBox &fb) const override
Pure virtual function. Derived classes MUST override this function to read an FArrayBox from the istr...
Definition AMReX_FArrayBox.cpp:915
void skip(std::istream &is, FArrayBox &f) const override
Pure virtual function. Derived classes MUST override this function to skip over the next FAB f in the...
Definition AMReX_FArrayBox.cpp:949
void write(std::ostream &os, const FArrayBox &fb, int comp, int num_comp) const override
Pure virtual function. Derived classes MUST override this function to write the FArrayBox to the ostr...
Definition AMReX_FArrayBox.cpp:929
A Class Facilitating I/O for Fabs.
Definition AMReX_FArrayBox.H:30
Format
An enum which controls format of FAB output.
Definition AMReX_FArrayBox.H:67
@ FAB_IEEE
Definition AMReX_FArrayBox.H:69
@ FAB_NATIVE_32
Definition AMReX_FArrayBox.H:77
@ FAB_ASCII
Definition AMReX_FArrayBox.H:68
@ FAB_NATIVE
Definition AMReX_FArrayBox.H:70
@ FAB_8BIT
Definition AMReX_FArrayBox.H:75
@ FAB_IEEE_32
Definition AMReX_FArrayBox.H:76
virtual void skip(std::istream &is, FArrayBox &f) const =0
Pure virtual function. Derived classes MUST override this function to skip over the next FAB f in the...
Precision
An enum which controls precision of FAB output. Valid values are FAB_FLOAT and FAB_DOUBLE....
Definition AMReX_FArrayBox.H:40
@ FAB_DOUBLE
Definition AMReX_FArrayBox.H:42
@ FAB_FLOAT
Definition AMReX_FArrayBox.H:41
virtual void read(std::istream &is, FArrayBox &fb) const =0
Pure virtual function. Derived classes MUST override this function to read an FArrayBox from the istr...
virtual void skip(std::istream &is, FArrayBox &f, int nCompToSkip) const =0
static FABio * read_header(std::istream &is, FArrayBox &f)
Read in the header from the istream. Returns a new'd FABio of the written-out type....
Definition AMReX_FArrayBox.cpp:448
virtual void write(std::ostream &os, const FArrayBox &fb, int comp, int num_comp) const =0
Pure virtual function. Derived classes MUST override this function to write the FArrayBox to the ostr...
Ordering
An enum which controls byte ordering of FAB output. Valid values are FAB_NORMAL_ORDER,...
Definition AMReX_FArrayBox.H:88
@ FAB_REVERSE_ORDER
Definition AMReX_FArrayBox.H:90
@ FAB_NORMAL_ORDER
Definition AMReX_FArrayBox.H:89
@ FAB_REVERSE_ORDER_2
Definition AMReX_FArrayBox.H:91
virtual ~FABio()=default
The virtual destructor.
virtual void write_header(std::ostream &os, const FArrayBox &f, int nvar) const
Write out a header describing FArrayBox f that contains nvar components. It must be the case that nva...
Definition AMReX_FArrayBox.cpp:95
A Fortran Array of REALs.
Definition AMReX_FArrayBox.H:231
void initVal() noexcept
Definition AMReX_FArrayBox.cpp:143
static void Finalize()
Definition AMReX_FArrayBox.cpp:431
static std::string getClassName()
Definition AMReX_FArrayBox.cpp:222
static bool initialized
Definition AMReX_FArrayBox.H:438
static Box skipFAB(std::istream &is, int &num_comp)
Skip over the next FAB from the input stream. Return the Box defining the domain of the FAB and the n...
Definition AMReX_FArrayBox.cpp:673
static void Initialize()
Initialize from ParmParse with "fab" prefix.
Definition AMReX_FArrayBox.cpp:333
static FABio::Precision getPrecision()
Returns the FABio::Precision. This is deprecated. It is not useful with the "new" FAB I/O format....
Definition AMReX_FArrayBox.cpp:298
FabType getType() const noexcept
Definition AMReX_FArrayBox.H:322
static void setOrdering(FABio::Ordering ordering)
Set the FABio::Ordering for reading old FABs. It does NOT set the ordering for output....
Definition AMReX_FArrayBox.cpp:278
void writeOn(std::ostream &os) const
Writes out the FAB in whatever format you've set. The default format is NATIVE.
Definition AMReX_FArrayBox.cpp:228
FArrayBox(Array4< Real const > const &a) noexcept
Definition AMReX_FArrayBox.H:263
static Real initval
Definition AMReX_FArrayBox.H:456
static const FABio & getFABio()
Returns reference to the FABio object used by the program.
Definition AMReX_FArrayBox.cpp:191
static void setFormat(FABio::Format fmt)
Set the FABio::Format in the program. This is the preferred way to set the output format in "new" FAB...
Definition AMReX_FArrayBox.cpp:241
static void setPrecision(FABio::Precision precision)
Set the FABio::Precision. This is deprecated. It is not useful with the "new" FAB I/O format.
Definition AMReX_FArrayBox.cpp:292
static void setFABio(FABio *rd)
Sets the FABio object used by the program. It is an error if the passed pointer rd is the null pointe...
Definition AMReX_FArrayBox.cpp:197
static FABio * fabio
The FABio pointer describing our output format.
Definition AMReX_FArrayBox.H:452
FabType m_type
Definition AMReX_FArrayBox.H:442
void readFrom(std::istream &is)
Read FAB from istream. Format is as it was written out.
Definition AMReX_FArrayBox.cpp:625
static FABio::Format format
Format and ordering for all FAB output. This stuff exists solely to support reading old FABs.
Definition AMReX_FArrayBox.H:448
FArrayBox(Array4< Real const > const &a, IndexType t) noexcept
Definition AMReX_FArrayBox.H:265
FArrayBox(Array4< Real > const &a, IndexType t) noexcept
Definition AMReX_FArrayBox.H:261
static FABio::Ordering ordering
Definition AMReX_FArrayBox.H:449
static std::unique_ptr< RealDescriptor > getDataDescriptor()
Definition AMReX_FArrayBox.cpp:205
static FABio::Ordering getOrdering()
Gets the FABio::Ordering set in the program. This is deprecated. It does NOT do the right thing with ...
Definition AMReX_FArrayBox.cpp:285
static Real get_initval()
Definition AMReX_FArrayBox.cpp:327
static bool do_initval
initial value
Definition AMReX_FArrayBox.H:455
bool contains_nan() const noexcept
Are there any NaNs in the FAB? This may return false, even if the FAB contains NaNs,...
Definition AMReX_FArrayBox.H:472
FArrayBox() noexcept=default
Construct an invalid FAB with no memory.
static FABio::Format getFormat()
Gets the FABio::Format set in the program.
Definition AMReX_FArrayBox.cpp:185
static Real set_initval(Real iv)
Definition AMReX_FArrayBox.cpp:319
static bool set_do_initval(bool tf)
Definition AMReX_FArrayBox.cpp:305
void resize(const Box &b, int N=1, Arena *ar=nullptr)
For debugging purposes we hide BaseFab version and do some extra work.
Definition AMReX_FArrayBox.cpp:178
static bool get_do_initval()
Definition AMReX_FArrayBox.cpp:313
static bool init_snan
Definition AMReX_FArrayBox.H:457
~FArrayBox() noexcept override=default
The destructor.
bool contains_inf() const noexcept
Are there any Infs in the FAB? This may return false, even if the FAB contains Infs,...
Definition AMReX_FArrayBox.H:604
GPU-compatible tuple.
Definition AMReX_Tuple.H:98
Dynamically allocated vector for trivially copyable data.
Definition AMReX_PODVector.H:308
T * data() noexcept
Definition AMReX_PODVector.H:666
A Descriptor of the Real Type.
Definition AMReX_FabConv.H:105
Definition AMReX_Reduce.H:257
Type value()
Definition AMReX_Reduce.H:289
Definition AMReX_Reduce.H:389
std::enable_if_t< IsFabArray< MF >::value > eval(MF const &mf, IntVect const &nghost, D &reduce_data, F &&f)
Definition AMReX_Reduce.H:458
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
amrex_long Long
Definition AMReX_INT.H:30
std::array< T, N > Array
Definition AMReX_Array.H:26
__host__ __device__ AMREX_FORCE_INLINE T Exch(T *address, T val) noexcept
Definition AMReX_GpuAtomic.H:487
void streamSynchronize() noexcept
Definition AMReX_GpuDevice.H:263
void dtoh_memcpy_async(void *p_h, const void *p_d, const std::size_t sz) noexcept
Definition AMReX_GpuDevice.H:315
bool inLaunchRegion() noexcept
Definition AMReX_GpuControl.H:92
void htod_memcpy_async(void *p_d, const void *p_h, const std::size_t sz) noexcept
Definition AMReX_GpuDevice.H:301
Definition AMReX_Amr.cpp:49
MakeType
Definition AMReX_MakeType.H:7
std::enable_if_t< std::is_integral_v< T > > ParallelFor(TypeList< CTOs... > ctos, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
Definition AMReX_CTOParallelForImpl.H:193
RunOn
Definition AMReX_GpuControl.H:69
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:33
FabType
Definition AMReX_FabFactory.H:18
A multidimensional array accessor.
Definition AMReX_Array4.H:224
void * alloc(std::size_t sz) const noexcept
Definition AMReX_DataAllocator.H:16