MaxMagnitude

class cubie.outputhandling.summarymetrics.max_magnitude.MaxMagnitude(precision)[source]

Bases: SummaryMetric

Summary metric that tracks the maximum absolute value of a variable.

Notes

A single buffer slot stores the running maximum magnitude. The buffer resets to 0.0 after each save.

__init__(precision) None[source]

Initialise the MaxMagnitude summary metric.

build() MetricFuncCache[source]

Generate CUDA device functions for maximum magnitude calculation.

Returns:

Cache containing the device update and save callbacks.

Return type:

MetricFuncCache

Notes

The update callback keeps the running maximum of absolute values while the save callback writes the result and resets the buffer.