OpenSWMM Engine  6.0.0-alpha.4
Data-oriented, plugin-extensible SWMM Engine (6.0.0-alpha.4)
Loading...
Searching...
No Matches
openswmm::twoD::gpu::kperf Namespace Reference

Namespaces

namespace  detail
 

Classes

struct  Counters
 
struct  KernelEntry
 
class  Scope
 

Functions

void install ()
 Registers the counting callbacks once per process. No-op unless OPENSWMM_PERF is set; defers to an external Kokkos tool if one is loaded.
 
void reset ()
 Replace active solver counters with empty defaults.
 
void count_advance ()
 Count one managed solver advance when profiling is enabled.
 
void dump ()
 One [PERF-2D-KOKKOS] summary line plus one line per kernel label, sorted by host-side dispatch wall descending. Same key=value contract as [PERF-FV] / [PERF-LOAD]; tests/benchmarks scripts can scrape it.
 

Variables

thread_local Counters * active = nullptr
 

Function Documentation

◆ count_advance()

void openswmm::twoD::gpu::kperf::count_advance ( )
inline

Count one managed solver advance when profiling is enabled.

Postcondition
Increments the active n_advance counter only when both a Scope and perf::enabled() exist. No allocation, synchronization or solver advancement.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ dump()

void openswmm::twoD::gpu::kperf::dump ( )
inline

One [PERF-2D-KOKKOS] summary line plus one line per kernel label, sorted by host-side dispatch wall descending. Same key=value contract as [PERF-FV] / [PERF-LOAD]; tests/benchmarks scripts can scrape it.

Note
No-op without active counters, disabled profiling, or zero advances. Allocates a temporary pointer vector to sort labels and may throw; counters remain unchanged. Output goes to stderr and can interleave with other threads; label seconds measure host dispatch wall, not device kernel time. Requires stable exclusive access while reading counters.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ install()

void openswmm::twoD::gpu::kperf::install ( )
inline

Registers the counting callbacks once per process. No-op unless OPENSWMM_PERF is set; defers to an external Kokkos tool if one is loaded.

Note
First-call initialization is process-wide and synchronized by C++ local-static initialization. Skipping because performance is disabled or an external tool environment variable exists is permanent for later calls. Registers callbacks globally but collects only inside an active Scope; does not own counter objects or initialize Kokkos.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ reset()

void openswmm::twoD::gpu::kperf::reset ( )
inline

Replace active solver counters with empty defaults.

Postcondition
No-op without an active Scope; otherwise clears all counts, labels and kernel entries. Does not clear pairing timestamp stacks or remove global callbacks.
Precondition
No dispatch/fence timing pair may be open across reset. Requires exclusive active-counter access; prior entry references are invalidated.
Here is the caller graph for this function:

Variable Documentation

◆ active

thread_local Counters* openswmm::twoD::gpu::kperf::active = nullptr
inline