Mojo struct
BenchConfig
Defines a benchmark configuration struct to control execution times and frequency.
Aliasesβ
VERBOSE_TIMING_LABELS = "min (ms)", "mean (ms)", "max (ms)", "duration (ms)"
: Labels to print verbose timing results.
Fieldsβ
- βout_file (
Optional[Path]
): Output file to write results to. - βmin_runtime_secs (
SIMD[float64, 1]
): Upper bound on benchmarking time in secs. - βmax_runtime_secs (
SIMD[float64, 1]
): Lower bound on benchmarking time in secs. - βmax_batch_size (
Int
): The maximum number of iterations to perform per time measurement. - βmax_iters (
Int
): Max number of iterations to run. - βwarmup_iters (
Int
): Number of warmup iterations to run before starting benchmarking. - βnum_repetitions (
Int
): Number of times the benchmark has to be repeated. - βflush_denormals (
Bool
): Whether or not the denormal values are flushed. - βshow_progress (
Bool
): Whether or not to show the progress of each benchmark. - βtabular_view (
Bool
): Whether to print results in csv readable/tabular format. - βverbose_timing (
Bool
): Whether to print verbose timing results.
Implemented traitsβ
AnyType
,
CollectionElement
,
Copyable
,
Movable
Methodsβ
__init__
β
__init__(inout self: Self, out_file: Optional[Path] = #kgen.none, min_runtime_secs: SIMD[float64, 1] = #kgen.float_literal<1|10>, max_runtime_secs: SIMD[float64, 1] = 1, warmup_iters: Int = 2, max_batch_size: Int = 0, max_iters: Int = 1000000000, num_repetitions: Int = 1, flush_denormals: Bool = 1)
Constructs and initializes Benchmark config object with default and inputed values.
Args:
- βout_file (
Optional[Path]
): Output file to write results to. - βmin_runtime_secs (
SIMD[float64, 1]
): Upper bound on benchmarking time in secs (default0.1
). - βmax_runtime_secs (
SIMD[float64, 1]
): Lower bound on benchmarking time in secs (default1
). - βwarmup_iters (
Int
): Number of warmup iterations to run before starting benchmarking (default 2). - βmax_batch_size (
Int
): The maximum number of iterations to perform per time measurement. - βmax_iters (
Int
): Max number of iterations to run (default1_000_000_000
). - βnum_repetitions (
Int
): Number of times the benchmark has to be repeated. - βflush_denormals (
Bool
): Whether or not the denormal values are flushed.
__init__(inout self: Self, *, other: Self)
Explicitly construct a deep copy of the provided value.
Args:
- βother (
Self
): The value to copy.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!
π What went wrong?