Mojo struct
ThroughputMeasure
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
,
Copyable
,
Movable
,
UnknownDestructibility
Methods
__init__
__init__(out self, name: String, value: Int, reference: List[BenchMetric] = List(BenchMetric(0, "throughput", "GElems/s"), BenchMetric(1, "DataMovement", "GB/s"), BenchMetric(2, "Arithmetic", "GFLOPS/s"), Tuple()))
Creates a ThroughputMeasure
based on metric's name.
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:
__init__(out self, *, other: Self)
Explicitly construct a deep copy of the provided value.
Args:
- other (
Self
): The value to copy.
__str__
__str__(self) -> String
Gets a string representation of this ThroughputMeasure
.
Returns:
String
: The string representation.
write_to
write_to[W: Writer](self, mut writer: W)
Formats this ThroughputMeasure to the provided Writer.
Parameters:
- W (
Writer
): A type conforming to the Writable trait.
Args:
- writer (
W
): The object to write to.
compute
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!