Skip to content

Commit

Permalink
CUDA 12.4 (#227)
Browse files Browse the repository at this point in the history
* CUDA 12.4

* Fix formatting

---------

Co-authored-by: Corey Lowman <clowman1993@gmail.com>
  • Loading branch information
bitemyapp and coreylowman committed May 3, 2024
1 parent d95fcc7 commit 76430d1
Show file tree
Hide file tree
Showing 27 changed files with 52,444 additions and 5 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-12030", "f16", "cudnn"]
features = ["cuda-12040", "f16", "cudnn"]

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

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,14 +8,15 @@ fn main() {

#[cfg(not(any(
feature = "cuda-version-from-build-system",
feature = "cuda-12040",
feature = "cuda-12030",
feature = "cuda-12020",
feature = "cuda-12010",
feature = "cuda-12000",
feature = "cuda-11080",
feature = "cuda-11070",
)))]
compile_error!("Must specify one of the following features: [cuda-version-from-build-system, 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-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 @@ -43,6 +44,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() {
"12040" => println!("cargo:rustc-cfg=feature=\"cuda-12040\""),
"12030" => println!("cargo:rustc-cfg=feature=\"cuda-12030\""),
"12020" => println!("cargo:rustc-cfg=feature=\"cuda-12020\""),
"12010" => println!("cargo:rustc-cfg=feature=\"cuda-12010\""),
Expand Down
Empty file modified src/cublas/sys/bindgen.sh
100644 → 100755
Empty file.
5 changes: 5 additions & 0 deletions src/cublas/sys/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,11 @@ mod sys_12030;
#[cfg(feature = "cuda-12030")]
pub use sys_12030::*;

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

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 76430d1

Please sign in to comment.