struct
BenchMetric
Defines a benchmark throughput metric.
Aliases
elements = BenchMetric(0, "Elements", "GElement/s")
:bytes = BenchMetric(1, "Bytes", "GB/s")
:flops = BenchMetric(2, "FLOPS", "GFLOPS/s")
:DEFAULTS = BenchMetric(0, "Elements", "GElement/s"), BenchMetric(1, "Bytes", "GB/s"), BenchMetric(2, "FLOPS", "GFLOPS/s")
: Default set of benchmark metrics.
Fields
- code (
Int
): Op-code of the Metric. - name (
String
): Metric's name. - unit (
String
): Metric's throughput rate unit (count/second).
Implemented traits
AnyType
,
CollectionElement
,
Copyable
,
Movable
,
Stringable
Methods
__eq__
__eq__(self: Self, other: Self) -> Bool
Compares two metrics for equality.
Args:
- other (
Self
): The metric to compare.
Returns:
True if the two metrics are equal.
__ne__
__ne__(self: Self, other: Self) -> Bool
Compares two metrics for inequality.
Args:
- other (
Self
): The metric to compare.
Returns:
True if the two metrics are NOT equal.
check_name
check_name(self: Self, alt_name: String) -> Bool
Check whether a string contains the metric's name.
Args:
- alt_name (
String
): Alternative name of a metric.
Returns:
True if 'alt_name' is valid alternative of the metric's name.
get_metric_from_list
static get_metric_from_list(name: String, metric_list: List[BenchMetric]) -> Self
Return a metric from a given list by only using metric's name.
Args:
- name (
String
): Metric's name (String). - metric_list (
List[BenchMetric]
): List of metrics to search.
Returns:
Return a metric from a given list by only using metric's name.