Skip to content

Commit

Permalink
#245 Add cuda-11050 and cuda-11060 feature flags for older cuda toolk…
Browse files Browse the repository at this point in the history
…its (#249)
  • Loading branch information
coreylowman committed Jun 11, 2024
1 parent 6fa8132 commit aeb8c0d
Show file tree
Hide file tree
Showing 25 changed files with 76,586 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ features = ["cuda-12050", "f16", "cudnn"]
default = ["std", "cublas", "cublaslt", "cudnn", "curand", "driver", "nccl", "nvrtc"]

cuda-version-from-build-system = []
cuda-11050 = []
cuda-11060 = []
cuda-11070 = []
cuda-11080 = []
cuda-12000 = []
Expand Down
8 changes: 7 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ fn main() {
(11, 8)
} else if cfg!(feature = "cuda-11070") {
(11, 7)
} else if cfg!(feature = "cuda-11060") {
(11, 6)
} else if cfg!(feature = "cuda-11050") {
(11, 5)
} else {
#[cfg(not(feature = "cuda-version-from-build-system"))]
panic!("Must specify one of the following features: [cuda-version-from-build-system, cuda-12050, cuda-12040, cuda-12030, cuda-12020, cuda-12010, cuda-12000, cuda-11080, cuda-11070]");
panic!("Must specify one of the following features: [cuda-version-from-build-system, cuda-12050, cuda-12040, cuda-12030, cuda-12020, cuda-12010, cuda-12000, cuda-11080, cuda-11070, cuda-11060, cuda-11050]");

#[cfg(feature = "cuda-version-from-build-system")]
{
Expand Down Expand Up @@ -70,6 +74,8 @@ fn cuda_version_from_build_system() -> (usize, usize) {
"12.0" => (12, 0),
"11.8" => (11, 8),
"11.7" => (11, 7),
"11.6" => (11, 6),
"11.5" => (11, 5),
v => panic!("Unsupported cuda toolkit version: `{v}`. Please raise a github issue."),
}
}
Expand Down
10 changes: 10 additions & 0 deletions src/cublas/sys/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
#[cfg(feature = "cuda-11050")]
mod sys_11050;
#[cfg(feature = "cuda-11050")]
pub use sys_11050::*;

#[cfg(feature = "cuda-11060")]
mod sys_11060;
#[cfg(feature = "cuda-11060")]
pub use sys_11060::*;

#[cfg(feature = "cuda-11070")]
mod sys_11070;
#[cfg(feature = "cuda-11070")]
Expand Down
Loading

0 comments on commit aeb8c0d

Please sign in to comment.