candle_core/quantized/
dummy_cuda.rs

1#![allow(unused)]
2use super::GgmlDType;
3use crate::{CudaDevice, CudaStorage, Error, Result};
4
5pub struct QCudaStorage {
6    dtype: GgmlDType,
7    device: CudaDevice,
8}
9
10impl QCudaStorage {
11    pub fn zeros(_: &CudaDevice, _: usize, _: GgmlDType) -> Result<Self> {
12        Err(Error::NotCompiledWithCudaSupport)
13    }
14
15    pub fn dtype(&self) -> GgmlDType {
16        self.dtype
17    }
18
19    pub fn device(&self) -> &CudaDevice {
20        &self.device
21    }
22
23    pub fn dequantize(&self, _elem_count: usize) -> Result<CudaStorage> {
24        Err(Error::NotCompiledWithCudaSupport)
25    }
26
27    pub fn dequantize_f16(&self, _elem_count: usize) -> Result<CudaStorage> {
28        Err(Error::NotCompiledWithCudaSupport)
29    }
30
31    pub fn quantize(&mut self, _src: &CudaStorage) -> Result<()> {
32        Err(Error::NotCompiledWithCudaSupport)
33    }
34
35    pub fn storage_size_in_bytes(&self) -> usize {
36        0
37    }
38
39    pub fn fwd(
40        &self,
41        _self_shape: &crate::Shape,
42        _storage: &CudaStorage,
43        _layout: &crate::Layout,
44    ) -> Result<(CudaStorage, crate::Shape)> {
45        Err(Error::NotCompiledWithCudaSupport)
46    }
47}
48
49pub fn load_quantized<T: super::GgmlType + Send + Sync + 'static>(
50    _device: &CudaDevice,
51    _data: &[T],
52) -> Result<super::QStorage> {
53    Err(Error::NotCompiledWithCudaSupport)
54}