|
chombo-discharge
|
Namespace for encapsulating loop types. More...
Functions | |
| template<int Si, int Sj, int Sk, typename Functor > | |
| ALWAYS_INLINE void | loop (const Box &a_computeBox, Functor &&kernel) |
| Launch a C++ kernel over a regular grid with compile-time per-dimension strides. | |
| template<typename Functor > | |
| ALWAYS_INLINE void | loop (const IntVectSet &a_ivs, Functor &&a_kernel) |
| Launch a C++ kernel over a subset of cells. | |
| template<typename Functor > | |
| ALWAYS_INLINE void | loop (const DenseIntVectSet &a_ivs, Functor &&a_kernel) |
| Launch a C++ kernel over a subset of cells. | |
| template<typename Functor > | |
| ALWAYS_INLINE void | loop (VoFIterator &a_iter, Functor &&a_kernel) |
| Launch a C++ kernel over cut-cells. | |
| template<typename Functor > | |
| ALWAYS_INLINE void | loop (FaceIterator &a_iter, Functor &&a_kernel) |
| Launch a C++ kernel over faces. | |
| template<typename T , typename Functor > | |
| ALWAYS_INLINE void | loop (const Vector< T > &a_subset, Functor &&a_kernel) |
| Launch a C++ kernel over a specified subset of something. | |
Namespace for encapsulating loop types.
BoxLoops provides several overloads of loop for iterating over structured and unstructured grid data. The general pattern is:
where kernel is a callable (lambda or functor) taking the element type for that overload.
Box loop — compile-time stride: Strides are non-type template parameters, making their value visible to the compiler so the inner loop can be auto-vectorized. All strides must be >= 1 (enforced by static_assert). Use D_DECL for dimension-independent call sites. Unit-stride iteration is D_DECL(1,1,1):
VoF, face, and set iterators:
| ALWAYS_INLINE void BoxLoops::loop | ( | const Box & | a_computeBox, |
| Functor && | kernel | ||
| ) |
Launch a C++ kernel over a regular grid with compile-time per-dimension strides.
Strides are encoded as non-type template parameters, making them visible to the compiler as constants and enabling auto-vectorization of the innermost loop. All strides must be >= 1 (enforced by static_assert).
Note: IntVect cannot be a non-type template parameter in C++14, so per-dimension int parameters are used instead. Call sites can use D_DECL for dimension independence, e.g.:
| [in] | a_computeBox | Computation box |
| [in] | kernel | Kernel |
| ALWAYS_INLINE void BoxLoops::loop | ( | const DenseIntVectSet & | a_ivs, |
| Functor && | a_kernel | ||
| ) |
Launch a C++ kernel over a subset of cells.
| [in,out] | a_kernel | Kernel to launch |
| [in] | a_ivs | Ivs |
| ALWAYS_INLINE void BoxLoops::loop | ( | const IntVectSet & | a_ivs, |
| Functor && | a_kernel | ||
| ) |
Launch a C++ kernel over a subset of cells.
| [in,out] | a_kernel | Kernel to launch |
| [in] | a_ivs | Ivs |
Launch a C++ kernel over a specified subset of something.
| [in,out] | a_subset | Subset. E.g. a std::vector<VolIndex> |
| [in,out] | a_kernel | Kernel to launch |
| ALWAYS_INLINE void BoxLoops::loop | ( | FaceIterator & | a_iter, |
| Functor && | a_kernel | ||
| ) |
Launch a C++ kernel over faces.
| [in,out] | a_kernel | Kernel to launch |
| [in] | a_iter | Iter |
| ALWAYS_INLINE void BoxLoops::loop | ( | VoFIterator & | a_iter, |
| Functor && | a_kernel | ||
| ) |
Launch a C++ kernel over cut-cells.
| [in,out] | a_kernel | Kernel to launch |
| [in] | a_iter | Iter |