Skip to content

Commit b27d5f2

Browse files
committed
Fix: forgot about read_env
1 parent 076ba79 commit b27d5f2

File tree

1 file changed

+15
-0
lines changed
  • crates/find_cuda_helper/src

1 file changed

+15
-0
lines changed

crates/find_cuda_helper/src/lib.rs

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,21 @@ pub fn find_cuda_lib_dirs() -> Vec<PathBuf> {
107107
vec![]
108108
}
109109

110+
pub fn read_env() -> Vec<PathBuf> {
111+
if let Ok(path) = env::var("CUDA_LIBRARY_PATH") {
112+
// The location of the libcuda, libcudart, and libcublas can be hardcoded with the
113+
// CUDA_LIBRARY_PATH environment variable.
114+
let split_char = if cfg!(target_os = "windows") {
115+
";"
116+
} else {
117+
":"
118+
};
119+
path.split(split_char).map(PathBuf::from).collect()
120+
} else {
121+
vec![]
122+
}
123+
}
124+
110125
#[cfg(not(target_os = "windows"))]
111126
pub fn find_cuda_lib_dirs() -> Vec<PathBuf> {
112127
let mut candidates = read_env();

0 commit comments

Comments
 (0)