File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change 1
- use anyhow:: { Context , Result } ;
1
+ use anyhow:: { Context , Result , bail } ;
2
2
3
3
fn main ( ) {
4
4
println ! ( "cargo:rerun-if-env-changed=CUDA_COMPUTE_CAP" ) ;
@@ -22,10 +22,9 @@ fn set_compute_cap() -> Result<usize> {
22
22
. context ( "`nvidia-smi` failed. Ensure that you have CUDA installed and that `nvidia-smi` is in your PATH." ) ?;
23
23
let out = std:: str:: from_utf8 ( & out. stdout ) . context ( "stdout is not a utf8 string" ) ?;
24
24
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
+ }
29
28
let cap = lines
30
29
. next ( )
31
30
. context ( "missing line in stdout" ) ?
You can’t perform that action at this time.
0 commit comments