We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent acdb1a2 commit 2460b54Copy full SHA for 2460b54
src/driver/sys/mod.rs
@@ -58,6 +58,14 @@ mod sys_12060;
58
#[cfg(feature = "cuda-12060")]
59
pub use sys_12060::*;
60
61
+/// Check if the driver library is available on the system.
62
+pub fn is_available() -> bool {
63
+ let lib_name = "cuda";
64
+ let mut choices = crate::get_lib_name_candidates(lib_name);
65
+ choices.extend(crate::get_lib_name_candidates("nvcuda"));
66
+ choices.iter().any(|x| unsafe { Lib::new(x).is_ok() })
67
+}
68
+
69
pub unsafe fn lib() -> &'static Lib {
70
static LIB: std::sync::OnceLock<Lib> = std::sync::OnceLock::new();
71
LIB.get_or_init(|| {
0 commit comments