diff options
Diffstat (limited to 'candle-core/src/utils.rs')
-rw-r--r-- | candle-core/src/utils.rs | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/candle-core/src/utils.rs b/candle-core/src/utils.rs index 895c97e1..d3f5b50e 100644 --- a/candle-core/src/utils.rs +++ b/candle-core/src/utils.rs @@ -11,16 +11,14 @@ pub fn get_num_threads() -> usize { } } +pub fn has_accelerate() -> bool { + cfg!(feature = "accelerate") +} + pub fn has_mkl() -> bool { - #[cfg(feature = "mkl")] - return true; - #[cfg(not(feature = "mkl"))] - return false; + cfg!(feature = "mkl") } pub fn cuda_is_available() -> bool { - #[cfg(feature = "cuda")] - return true; - #[cfg(not(feature = "cuda"))] - return false; + cfg!(feature = "cuda") } |