Skip to content

Commit

Permalink
support CUDA Toolking 12.5 (#238)
Browse files Browse the repository at this point in the history
  • Loading branch information
Bartek Ogryczak authored May 29, 2024
1 parent 13fe59e commit eb52843
Show file tree
Hide file tree
Showing 17 changed files with 51,135 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ keywords = [
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[package.metadata.docs.rs]
features = ["cuda-12040", "f16", "cudnn"]
features = ["cuda-12050", "f16", "cudnn"]

[features]
default = ["std", "cublas", "cublaslt", "cudnn", "curand", "driver", "nccl", "nvrtc"]
Expand All @@ -34,6 +34,7 @@ cuda-12010 = []
cuda-12020 = []
cuda-12030 = []
cuda-12040 = []
cuda-12050 = []

dynamic-linking = []

Expand Down
4 changes: 3 additions & 1 deletion build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ fn main() {

#[cfg(not(any(
feature = "cuda-version-from-build-system",
feature = "cuda-12050",
feature = "cuda-12040",
feature = "cuda-12030",
feature = "cuda-12020",
Expand All @@ -16,7 +17,7 @@ fn main() {
feature = "cuda-11080",
feature = "cuda-11070",
)))]
compile_error!("Must specify one of the following features: [cuda-version-from-build-system, cuda-12040, cuda-12030, cuda-12020, cuda-12010, cuda-12000, cuda-11080, cuda-11070]");
compile_error!("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]");

#[cfg(feature = "cuda-version-from-build-system")]
cuda_version_from_build_system();
Expand Down Expand Up @@ -44,6 +45,7 @@ fn cuda_version_from_build_system() {
let key = "CUDA_VERSION ";
let start = key.len() + contents.find(key).unwrap();
match contents[start..].lines().next().unwrap() {
"12050" => println!("cargo:rustc-cfg=feature=\"cuda-12050\""),
"12040" => println!("cargo:rustc-cfg=feature=\"cuda-12040\""),
"12030" => println!("cargo:rustc-cfg=feature=\"cuda-12030\""),
"12020" => println!("cargo:rustc-cfg=feature=\"cuda-12020\""),
Expand Down
5 changes: 5 additions & 0 deletions src/cublas/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,11 @@ mod sys_12040;
#[cfg(feature = "cuda-12040")]
pub use sys_12040::*;

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

pub unsafe fn lib() -> &'static Lib {
static LIB: std::sync::OnceLock<Lib> = std::sync::OnceLock::new();
LIB.get_or_init(|| Lib::new(libloading::library_filename("cublas")).unwrap())
Expand Down
Loading

0 comments on commit eb52843

Please sign in to comment.