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
,
ImplicitlyCopyable
,
Movable
,
UnknownDestructibility
Aliases
__copyinit__is_trivial
alias __copyinit__is_trivial = Int.__copyinit__is_trivial if BenchMetric.__copyinit__is_trivial else BenchMetric.__copyinit__is_trivial
__del__is_trivial
alias __del__is_trivial = Int.__del__is_trivial if BenchMetric.__del__is_trivial else BenchMetric.__del__is_trivial
__moveinit__is_trivial
alias __moveinit__is_trivial = Int.__moveinit__is_trivial if BenchMetric.__moveinit__is_trivial else BenchMetric.__moveinit__is_trivial
Methods
__init__
__init__(out self, name: String, value: Int, reference: List[BenchMetric] = List[BenchMetric](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:
__str__
__str__(self) -> String
Gets a string representation of this ThroughputMeasure
.
Returns:
String
: The string representation.
write_to
write_to(self, mut writer: T)
Formats this ThroughputMeasure to the provided Writer.
Args:
- writer (
T
): 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!