Skip to content

Commit

Permalink
Add error descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
bazhenov committed Jan 5, 2025
1 parent 96fc1d0 commit 90170f9
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions tango-bench/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -464,7 +464,7 @@ mod paired_test {

let mut spi_self = Spi::for_self(mode).ok_or(Error::SpiSelfWasMoved)?;
let mut spi_lib = Spi::for_library(&path, mode)
.with_context(|| format!("Unable to load library: {}", path.display()))?;
.with_context(|| format!("Unale to load library: {}", path.display()))?;

Check warning on line 467 in tango-bench/src/cli.rs

View workflow job for this annotation

GitHub Actions / lint

"Unale" should be "Unable".

settings.filter_outliers = filter_outliers;
settings.cache_firewall = cache_firewall;
Expand Down Expand Up @@ -601,12 +601,24 @@ mod paired_test {

let seed = seed.unwrap_or_else(rand::random);

a_func.spi.prepare_state(seed)?;
let a_iters = a_func.spi.estimate_iterations(TIME_SLICE_MS)?;
a_func
.spi
.prepare_state(seed)
.context("Unable to prepare benchmark state")?;
let a_iters = a_func
.spi
.estimate_iterations(TIME_SLICE_MS)
.context("Failed to estimate required iterations number")?;
let a_estimate = (a_iters / 2).max(1);

b_func.spi.prepare_state(seed)?;
let b_iters = b_func.spi.estimate_iterations(TIME_SLICE_MS)?;
b_func
.spi
.prepare_state(seed)
.context("Unable to prepare benchmark state")?;
let b_iters = b_func
.spi
.estimate_iterations(TIME_SLICE_MS)
.context("Failed to estimate required iterations number")?;
let b_estimate = (b_iters / 2).max(1);

let mut iterations_per_sample = a_estimate.min(b_estimate);
Expand Down

0 comments on commit 90170f9

Please sign in to comment.