Skip to content

Commit d05c949

Browse files
fix(build): remove assert_eq (#128)
1 parent b083e00 commit d05c949

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

backends/candle/build.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use anyhow::{Context, Result};
1+
use anyhow::{Context, Result, bail};
22

33
fn main() {
44
println!("cargo:rerun-if-env-changed=CUDA_COMPUTE_CAP");
@@ -22,10 +22,9 @@ fn set_compute_cap() -> Result<usize> {
2222
.context("`nvidia-smi` failed. Ensure that you have CUDA installed and that `nvidia-smi` is in your PATH.")?;
2323
let out = std::str::from_utf8(&out.stdout).context("stdout is not a utf8 string")?;
2424
let mut lines = out.lines();
25-
assert_eq!(
26-
lines.next().context("missing line in stdout")?,
27-
"compute_cap"
28-
);
25+
if lines.next().context("missing line in stdout")? != "compute_cap" {
26+
bail!("First line should be `compute_cap`");
27+
}
2928
let cap = lines
3029
.next()
3130
.context("missing line in stdout")?

0 commit comments

Comments
 (0)