1#ifndef AMREX_MF_PARALLEL_FOR_H_
2#define AMREX_MF_PARALLEL_FOR_H_
3#include <AMReX_Config.H>
42template <FabArrayType MF,
typename F>
65template <
int MT, FabArrayType MF,
typename F>
92template <FabArrayType MF,
typename F>
116template <
int MT, FabArrayType MF,
typename F>
144template <FabArrayType MF,
typename F>
169template <
int MT, FabArrayType MF,
typename F>
197template <FabArrayType MF,
typename F>
201 detail::ParallelFor_doit(mf,
IntVect(0), ts.
tile_size,
false, std::forward<F>(f));
222template <
int MT, FabArrayType MF,
typename F>
227 detail::ParallelFor_doit<MT>(mf,
IntVect(0), 1, ts.
tile_size,
false, std::forward<F>(f));
229 detail::ParallelFor_doit(mf,
IntVect(0), ts.
tile_size,
false, std::forward<F>(f));
251template <FabArrayType MF,
typename F>
255 detail::ParallelFor_doit(mf, ng, ts.
tile_size,
false, std::forward<F>(f));
277template <
int MT, FabArrayType MF,
typename F>
282 detail::ParallelFor_doit<MT>(mf, ng, 1, ts.
tile_size,
false, std::forward<F>(f));
284 detail::ParallelFor_doit(mf, ng, ts.
tile_size,
false, std::forward<F>(f));
307template <FabArrayType MF,
typename F>
311 detail::ParallelFor_doit(mf, ng, ncomp, ts.
tile_size,
false, std::forward<F>(f));
334template <
int MT, FabArrayType MF,
typename F>
339 detail::ParallelFor_doit<MT>(mf, ng, ncomp, ts.
tile_size,
false, std::forward<F>(f));
341 detail::ParallelFor_doit(mf, ng, ncomp, ts.
tile_size,
false, std::forward<F>(f));
364template <FabArrayType MF,
typename F>
368 detail::ParallelFor_doit(mf, ng, ts.
tile_size, dt.
dynamic, std::forward<F>(f));
391template <FabArrayType MF,
typename F>
396 detail::ParallelFor_doit(mf, ng, ncomp, ts.
tile_size, dt.
dynamic, std::forward<F>(f));
419template <
int MT, FabArrayType MF,
typename F>
425 detail::ParallelFor_doit<MT>(mf, ng, 1, ts.
tile_size, dt.
dynamic, std::forward<F>(f));
427 detail::ParallelFor_doit(mf, ng, ts.
tile_size, dt.
dynamic, std::forward<F>(f));
452template <
int MT, FabArrayType MF,
typename F>
458 detail::ParallelFor_doit<MT>(mf, ng, ncomp, ts.
tile_size, dt.
dynamic, std::forward<F>(f));
460 detail::ParallelFor_doit(mf, ng, ncomp, ts.
tile_size, dt.
dynamic, std::forward<F>(f));
495template <FabArrayType MF,
typename F>
502 for (
int d = 0; d < AMREX_SPACEDIM; ++d) {
503 o[d] = ((
offset[d] % stride[d]) + stride[d]) % stride[d];
505 detail::ParallelForStrided_doit(mf, stride, o, std::forward<F>(f));
527template <FabArrayType MF,
typename F>
531 detail::ParallelForRedBlack_doit(mf, redblack, std::forward<F>(f));
546template <FabArrayType MF,
typename F>
551 detail::ParallelForRedBlack_doit(mf, redblack,
554 f(box_no, i, j, k, 0);
557 detail::ParallelForRedBlack_doit(mf, redblack,
560 for (
int n = 0; n < ncomp; ++n) {
561 f(box_no, i, j, k, n);
#define AMREX_ASSERT(EX)
Definition AMReX_BLassert.H:38
Common infrastructure shared by FabArray specializations.
#define AMREX_GPU_DEVICE
Definition AMReX_GpuQualifiers.H:18
Array4< int const > offset
Definition AMReX_HypreMLABecLap.cpp:1139
#define AMREX_D_DECL(a, b, c)
Definition AMReX_SPACE.H:171
static IntVect mfiter_tile_size
Default tilesize in MFIter.
Definition AMReX_FabArrayBase.H:306
__host__ __device__ constexpr bool allGT(const IntVectND< dim > &rhs) const noexcept
Returns true if this is greater than argument for all components. NOTE: This is NOT a strict weak ord...
Definition AMReX_IntVect.H:517
Definition AMReX_Amr.cpp:50
void ParallelForRedBlack(MF const &mf, int redblack, F &&f)
ParallelFor over the red or black points of the valid region of a MultiFab/FabArray.
Definition AMReX_MFParallelFor.H:529
constexpr IntVect multicolor_offset(int color) noexcept
Index offset of one color of a multi-color sweep.
Definition AMReX_MFParallelFor.H:470
void ParallelFor(TypeList< CTOs... > ctos, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
Definition AMReX_CTOParallelForImpl.H:202
void ParallelForStrided(MF const &mf, IntVect const &stride, IntVect const &offset, F &&f)
ParallelFor over a strided subset of the valid region of a MultiFab/FabArray.
Definition AMReX_MFParallelFor.H:497
IntVectND< 3 > IntVect
IntVect is an alias for amrex::IntVectND instantiated with AMREX_SPACEDIM.
Definition AMReX_BaseFwd.H:38
Definition AMReX_MFParallelFor.H:22
DynamicTiling(bool f) noexcept
Definition AMReX_MFParallelFor.H:24
bool dynamic
Definition AMReX_MFParallelFor.H:23
Definition AMReX_MFParallelFor.H:17
TileSize(IntVect const &ts) noexcept
Definition AMReX_MFParallelFor.H:19
IntVect tile_size
Definition AMReX_MFParallelFor.H:18