summaryrefslogtreecommitdiff
path: root/src/dummy_cuda_backend.rs
diff options
context:
space:
mode:
authorlaurent <laurent.mazare@gmail.com>2023-06-22 07:51:53 +0100
committerlaurent <laurent.mazare@gmail.com>2023-06-22 07:51:53 +0100
commitfc26bab3ede511c3c4d2f1afb15f58eb6c588c94 (patch)
tree8ca6d8cf9a493b7c1d6f59a1f0181b6a2f405703 /src/dummy_cuda_backend.rs
parentdb35b310504ab97044b2c3826de72f9bccf86415 (diff)
downloadcandle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.tar.gz
candle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.tar.bz2
candle-fc26bab3ede511c3c4d2f1afb15f58eb6c588c94.zip
Add some specific errors rather than panicking.
Diffstat (limited to 'src/dummy_cuda_backend.rs')
-rw-r--r--src/dummy_cuda_backend.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/dummy_cuda_backend.rs b/src/dummy_cuda_backend.rs
index f555327f..85b5f598 100644
--- a/src/dummy_cuda_backend.rs
+++ b/src/dummy_cuda_backend.rs
@@ -1,5 +1,5 @@
#![allow(dead_code)]
-use crate::{CpuStorage, DType, Result, Shape};
+use crate::{CpuStorage, DType, Error, Result, Shape};
pub type CudaError = std::io::Error;
@@ -14,7 +14,7 @@ macro_rules! fail {
impl CudaDevice {
pub(crate) fn new(_: usize) -> Result<Self> {
- fail!()
+ Err(Error::NotCompiledWithCudaSupport)
}
pub(crate) fn ordinal(&self) -> usize {
@@ -22,11 +22,11 @@ impl CudaDevice {
}
pub(crate) fn zeros_impl(&self, _shape: &Shape, _dtype: DType) -> Result<CudaStorage> {
- fail!()
+ Err(Error::NotCompiledWithCudaSupport)
}
pub(crate) fn cuda_from_cpu_storage(&self, _: &CpuStorage) -> Result<CudaStorage> {
- fail!()
+ Err(Error::NotCompiledWithCudaSupport)
}
}
@@ -43,10 +43,10 @@ impl CudaStorage {
}
pub(crate) fn to_cpu_storage(&self) -> Result<CpuStorage> {
- fail!()
+ Err(Error::NotCompiledWithCudaSupport)
}
pub(crate) fn affine_impl(&self, _: &Shape, _: &[usize], _: f64, _: f64) -> Result<Self> {
- fail!()
+ Err(Error::NotCompiledWithCudaSupport)
}
}