summaryrefslogtreecommitdiff
path: root/src/dummy_cuda_backend.rs
diff options
context:
space:
mode:
authorLaurent Mazare <laurent.mazare@gmail.com>2023-06-21 21:37:54 +0100
committerGitHub <noreply@github.com>2023-06-21 21:37:54 +0100
commitdb35b310504ab97044b2c3826de72f9bccf86415 (patch)
tree710596156a4c026d4dd2ba804fab79b6cdafae3b /src/dummy_cuda_backend.rs
parent7c317f9611c263f10d661b44151d3655a2fa3b90 (diff)
parent7c46de9584fd4315b84d3bc4c28cf1b2bad7785d (diff)
downloadcandle-db35b310504ab97044b2c3826de72f9bccf86415.tar.gz
candle-db35b310504ab97044b2c3826de72f9bccf86415.tar.bz2
candle-db35b310504ab97044b2c3826de72f9bccf86415.zip
Merge pull request #3 from LaurentMazare/cuda
Add Cuda support.
Diffstat (limited to 'src/dummy_cuda_backend.rs')
-rw-r--r--src/dummy_cuda_backend.rs52
1 files changed, 52 insertions, 0 deletions
diff --git a/src/dummy_cuda_backend.rs b/src/dummy_cuda_backend.rs
new file mode 100644
index 00000000..f555327f
--- /dev/null
+++ b/src/dummy_cuda_backend.rs
@@ -0,0 +1,52 @@
+#![allow(dead_code)]
+use crate::{CpuStorage, DType, Result, Shape};
+
+pub type CudaError = std::io::Error;
+
+#[derive(Debug, Clone)]
+pub struct CudaDevice;
+
+macro_rules! fail {
+ () => {
+ unimplemented!("cuda support has not been enabled")
+ };
+}
+
+impl CudaDevice {
+ pub(crate) fn new(_: usize) -> Result<Self> {
+ fail!()
+ }
+
+ pub(crate) fn ordinal(&self) -> usize {
+ fail!()
+ }
+
+ pub(crate) fn zeros_impl(&self, _shape: &Shape, _dtype: DType) -> Result<CudaStorage> {
+ fail!()
+ }
+
+ pub(crate) fn cuda_from_cpu_storage(&self, _: &CpuStorage) -> Result<CudaStorage> {
+ fail!()
+ }
+}
+
+#[derive(Debug, Clone)]
+pub struct CudaStorage;
+
+impl CudaStorage {
+ pub fn dtype(&self) -> DType {
+ fail!()
+ }
+
+ pub fn device(&self) -> CudaDevice {
+ fail!()
+ }
+
+ pub(crate) fn to_cpu_storage(&self) -> Result<CpuStorage> {
+ fail!()
+ }
+
+ pub(crate) fn affine_impl(&self, _: &Shape, _: &[usize], _: f64, _: f64) -> Result<Self> {
+ fail!()
+ }
+}