DeferredMaps Class Reference#
|
DiFfRG
Discretization Framework for functional Renormalization Group flows
|
Scope in which map() results are landed lazily instead of one blocking copy per call. More...
#include <map_completion.hh>
Public Member Functions | |
| DeferredMaps () | |
| ~DeferredMaps () | |
| DeferredMaps (const DeferredMaps &)=delete | |
| DeferredMaps & | operator= (const DeferredMaps &)=delete |
Detailed Description
Scope in which map() results are landed lazily instead of one blocking copy per call.
Wrap a run of flows that do not read each other's results:
{
DeferredMaps defer;
flows.ZA4.map(&residual[idxv("ZA4")], coords, args);
flows.ZA3.map(&residual[idxv("ZA3")], coords, args);
...
} // one fence here, then all results land
Inside the scope the host keeps issuing work instead of blocking on each result, so the GPU does not drain between flows. Reading any of the destinations before the scope closes is a use-before-write bug; nest a flush_maps() if a value is genuinely needed early.
Call order inside the scope does not matter. Device maps launch asynchronously and host maps are queued (see MapCompletion::record_work), so a mixed block is executed as "launch every device map, then run the host maps while they are in flight, then fence" no matter which order it was written in. That is also the fastest available schedule: wall time is the larger of the two totals, not their sum. Without the queue, a host map placed between two device maps would stall the second launch until it finished.
Non-reentrant by design: a nested scope would flush at the inner closing brace and surprise the outer one, so nesting is not supported.
Constructor & Destructor Documentation
◆ DeferredMaps() [1/2]
|
inline |
◆ ~DeferredMaps()
|
inline |
◆ DeferredMaps() [2/2]
|
delete |
Member Function Documentation
◆ operator=()
|
delete |
The documentation for this class was generated from the following file:
- /home/runner/work/DiFfRG_current/DiFfRG_current/DiFfRG/include/DiFfRG/physics/integration/map_completion.hh
Generated by