include/pops/core/foundation/cold.hpp File ReferenceΒΆ

adc_cpp: include/pops/core/foundation/cold.hpp File Reference
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
cold.hpp File Reference

POPS_COLD_FN: opt out the COLD host factories from the optimizer (ADC-337, P1-B). More...

+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define POPS_COLD_FN
 

Detailed Description

POPS_COLD_FN: opt out the COLD host factories from the optimizer (ADC-337, P1-B).

The string->closure wiring (dispatch_*, make_block*, build_*_for, resolve_implicit_components) runs ONCE per block at construction time, on the host, never inside the time loop. Compiling it at -O3 is pure waste: the backend inlines and optimizes the entire CompositeModel instantiation tree into one giant factory function – the dominant slice of the heavy translation units' -O3 cost (cf. docs/BUILD_PROFILING.md). Marking these factories no-optimize keeps that wiring at -O0 while the HOT kernels (BlockRhsEval / Advance* / take_step / Kokkos for_each_cell) stay -O3: they are SEPARATE functions, reached through std::function closures, so the factory's -O0 does not de-optimize them. No -ffast-math anywhere, and -O0 vs -O3 never changes IEEE results, so the numerics stay bit-identical (the dmax==0 parity suite guards this).

Placement: between the template clause and the return type, e.g. template <class Visitor> POPS_COLD_FN void dispatch_transport(...) { ... }

NEVER apply it to a hot kernel or to a function that runs per cell / per step.

Macro Definition Documentation

◆ POPS_COLD_FN

#define POPS_COLD_FN