Skip to main content

struct

ThroughputMeasure

Records a throughput metric of metric BenchMetric and value.

Fields

  • metric (BenchMetric): Type of throughput metric.
  • value (Int): Measured count of throughput metric.

Implemented traits

AnyType, CollectionElement, Copyable, Movable, Stringable

Methods

__init__

__init__(inout self: Self, name: String, value: Int, reference: List[BenchMetric] = BenchMetric(0, "Elements", "GElement/s"), BenchMetric(1, "Bytes", "GB/s"), BenchMetric(2, "FLOPS", "GFLOPS/s"))

Create a ThroughputMeasure based on metric's name (String).

Example: For the default bench metrics BenchMetric.DEFAULTS the following are equivalent: - ThroughputMeasure(BenchMetric.fmas, 1024) - ThroughputMeasure("fmas", 1024) - ThroughputMeasure("fmas", 1024, BenchMetric.DEFAULTS)

Args:

  • name (String): The name of BenchMetric in its corresponding reference.
  • value (Int): The measured value to assign to this metric.
  • reference (List[BenchMetric]): Reference variadic list of BenchMetrics that contains this metric.

compute

compute(self: Self, elapsed_sec: SIMD[float64, 1]) -> SIMD[float64, 1]

Compute throughput rate for this metric per unit of time (second).

Args:

  • elapsed_sec (SIMD[float64, 1]): Elapsed time measured in seconds.

Returns:

The throughput values as a floating point 64.