include/pops/mesh/execution/for_each.hpp Source FileΒΆ
|
adc_cpp 0.3.0
Model-free C++23 core for coupled hyperbolic-elliptic systems on adaptive (AMR) meshes, with MPI and GPU (Kokkos) backends
|
for_each.hpp
Go to the documentation of this file.
21#include <pops/core/foundation/kokkos_env.hpp> // detail::ensure_kokkos_initialized + device_fence (life cycle)
34 "adc_cpp is Kokkos-only: for_each_cell requires POPS_HAS_KOKKOS. Configure with -DPOPS_USE_KOKKOS=ON and a Kokkos Serial/OpenMP/Cuda install."
145 // DEVICE GUARD (if constexpr): the serial fallback is taken ONLY if the default execution space
232// for a Model-template kernel instantiated from an EXTERNAL TRANSLATION UNIT (add_compiled_model),
233// where nvcc does not reliably emit an extended lambda (cf. the named functors of spatial_operator.hpp).
234// Determinism and bit-exactness IDENTICAL to for_each_cell_reduce_max (same Kokkos::Max): only the
263// SUM variant with a REDUCING FUNCTOR: exact counterpart of reduce_max_cell for Kokkos::Sum. @p f
264// receives (i, j, Real& acc) and accumulates (acc += value), passed DIRECTLY to parallel_reduce WITHOUT
266// the device-clean path required by a kernel instantiated from an EXTERNAL TRANSLATION UNIT (the
267// Krylov solver drawn from the native harness/loader): nvcc does not reliably emit an extended lambda
269// Determinism and FP IDENTICAL to for_each_cell_reduce_sum: same per-tile deterministic Kokkos::Sum.
Box2D: the integer index space of a 2D cell-centered Cartesian grid.
Shared Kokkos lifecycle: lazy init + device barrier.
std::int64_t foreach_serial_threshold()
Definition for_each.hpp:69
Definition amr_hierarchy.hpp:29
Real for_each_cell_reduce_sum(const Box2D &b, F f)
SUM reduction of f(i, j) over box b.
Definition for_each.hpp:199
void for_each_cell(const Box2D &b, F f)
Applies f to EACH cell (i, j) of box b (bounds inclusive), via Kokkos::parallel_for (Serial / OpenMP ...
Definition for_each.hpp:138
void sync_host()
Makes the HOST residency valid before a host access (read/write from the host).
Definition for_each.hpp:125
Real for_each_cell_reduce_max(const Box2D &b, F f)
MAX reduction of f(i, j) over box b.
Definition for_each.hpp:213
void device_fence()
Device barrier: waits for in-flight kernels to finish before a HOST access to unified memory.
Definition kokkos_env.hpp:43
Real reduce_sum_cell(const Box2D &b, F f)
SUM reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and accumulates,...
Definition for_each.hpp:274
Real reduce_max_cell(const Box2D &b, F f)
MAX reduction with a REDUCING FUNCTOR: f receives (i, j, Real& acc) and updates acc,...
Definition for_each.hpp:240
void sync_device()
Marks a DEVICE residency (upcoming kernel).
Definition for_each.hpp:132
Base scalar types and the POPS_HD macro (host+device portability).
Generated by