mirror of
https://github.com/huggingface/candle.git
synced 2025-06-17 11:08:52 +00:00
Small improvement to the cuda panic.
This commit is contained in:
@ -6,21 +6,27 @@ pub type CudaError = std::io::Error;
|
|||||||
#[derive(Debug, Clone)]
|
#[derive(Debug, Clone)]
|
||||||
pub struct CudaDevice;
|
pub struct CudaDevice;
|
||||||
|
|
||||||
|
macro_rules! fail {
|
||||||
|
() => {
|
||||||
|
unimplemented!("cuda support has not been enabled")
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
impl CudaDevice {
|
impl CudaDevice {
|
||||||
pub(crate) fn new(_: usize) -> Result<Self> {
|
pub(crate) fn new(_: usize) -> Result<Self> {
|
||||||
unimplemented!("cuda support hasn't been enabled")
|
fail!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn ordinal(&self) -> usize {
|
pub(crate) fn ordinal(&self) -> usize {
|
||||||
unimplemented!("cuda support hasn't been enabled")
|
fail!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn zeros_impl(&self, _shape: &Shape, _dtype: DType) -> Result<CudaStorage> {
|
pub(crate) fn zeros_impl(&self, _shape: &Shape, _dtype: DType) -> Result<CudaStorage> {
|
||||||
unimplemented!("cuda support hasn't been enabled")
|
fail!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn cuda_from_cpu_storage(&self, _: &CpuStorage) -> Result<CudaStorage> {
|
pub(crate) fn cuda_from_cpu_storage(&self, _: &CpuStorage) -> Result<CudaStorage> {
|
||||||
unimplemented!("cuda support hasn't been enabled")
|
fail!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -29,18 +35,18 @@ pub struct CudaStorage;
|
|||||||
|
|
||||||
impl CudaStorage {
|
impl CudaStorage {
|
||||||
pub fn dtype(&self) -> DType {
|
pub fn dtype(&self) -> DType {
|
||||||
unimplemented!()
|
fail!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn device(&self) -> CudaDevice {
|
pub fn device(&self) -> CudaDevice {
|
||||||
unimplemented!()
|
fail!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn to_cpu_storage(&self) -> Result<CpuStorage> {
|
pub(crate) fn to_cpu_storage(&self) -> Result<CpuStorage> {
|
||||||
unimplemented!()
|
fail!()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn affine_impl(&self, _: &Shape, _: &[usize], _: f64, _: f64) -> Result<Self> {
|
pub(crate) fn affine_impl(&self, _: &Shape, _: &[usize], _: f64, _: f64) -> Result<Self> {
|
||||||
unimplemented!()
|
fail!()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user