summaryrefslogtreecommitdiff
path: root/candle-core/src/device.rs
diff options
context:
space:
mode:
Diffstat (limited to 'candle-core/src/device.rs')
-rw-r--r--candle-core/src/device.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/candle-core/src/device.rs b/candle-core/src/device.rs
index 563d892b..65232839 100644
--- a/candle-core/src/device.rs
+++ b/candle-core/src/device.rs
@@ -101,6 +101,13 @@ impl Device {
}
}
+ pub fn is_cpu(&self) -> bool {
+ match self {
+ Self::Cpu => true,
+ Self::Cuda(_) => false,
+ }
+ }
+
pub fn is_cuda(&self) -> bool {
match self {
Self::Cpu => false,