Skip to content

Commit

Permalink
Panic only when HIP installation is not found from an env var
Browse files Browse the repository at this point in the history
  • Loading branch information
syl20bnr committed Nov 21, 2024
1 parent da8a08c commit 7d786a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion crates/cubecl-hip-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ fn main() {
.into_iter()
.filter_map(|var| env::var(var).ok())
.collect();
// default installation path
paths.push("/opt/rocm".to_string());

let rocm_path = paths.iter().find(|path| {
Expand All @@ -22,7 +23,7 @@ fn main() {
println!("cargo:rustc-link-lib=dylib=hiprtc");
println!("cargo:rustc-link-lib=dylib=amdhip64");
println!("cargo:rustc-link-search=native={}/lib", valid_rocm_path);
} else if !paths.is_empty() {
} else if paths.len() > 1 {
panic!("HIP headers not found in any of the defined CUBECL_ROCM_PATH, ROCM_PATH or HIP_PATH directories.");
}
}

0 comments on commit 7d786a6

Please sign in to comment.