summaryrefslogtreecommitdiff
path: root/candle-core/src/utils.rs
diff options
context:
space:
mode:
Diffstat (limited to 'candle-core/src/utils.rs')
-rw-r--r--candle-core/src/utils.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/candle-core/src/utils.rs b/candle-core/src/utils.rs
index b5621e56..895c97e1 100644
--- a/candle-core/src/utils.rs
+++ b/candle-core/src/utils.rs
@@ -17,3 +17,10 @@ pub fn has_mkl() -> bool {
#[cfg(not(feature = "mkl"))]
return false;
}
+
+pub fn cuda_is_available() -> bool {
+ #[cfg(feature = "cuda")]
+ return true;
+ #[cfg(not(feature = "cuda"))]
+ return false;
+}