Mojo function
run
run[*, func1: fn() raises -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = 60, max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func1 (
fn() raises -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.
run[*, func2: fn() -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = 60, max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func2 (
fn() -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.
run[func3: fn() raises capturing -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = 60, max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func3 (
fn() raises capturing -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.
run[*, func4: fn() capturing -> None](num_warmup_iters: Int = 1, max_iters: Int = 1000000000, min_runtime_secs: Float64 = 0.10000000000000001, max_runtime_secs: Float64 = 60, max_batch_size: Int = 0) -> Report
Benchmarks the function passed in as a parameter.
Benchmarking continues until 'min_runtime_secs' has elapsed and either
max_runtime_secs OR max_iters is achieved.
Parameters:
- func4 (
fn() capturing -> None): The function to benchmark.
Args:
- num_warmup_iters (
Int): Number of warmup iterations. - max_iters (
Int): Max number of iterations to run (default1_000_000_000). - min_runtime_secs (
Float64): Lower bound on benchmarking time in secs (default0.1). - max_runtime_secs (
Float64): Upper bound on benchmarking time in secs (default60). - max_batch_size (
Int): The maximum number of iterations to perform per time measurement.
Returns:
Report: Average execution time of func in ns.
Raises:
If the operation fails.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!