Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CUDA 12.6. #286

Merged
merged 1 commit into from
Sep 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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-12050", "f16", "cudnn"]
features = ["cuda-12060", "f16", "cudnn"]

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

dynamic-linking = []

Expand Down
7 changes: 5 additions & 2 deletions build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ fn main() {
println!("cargo:rerun-if-env-changed=CUDA_PATH");
println!("cargo:rerun-if-env-changed=CUDA_TOOLKIT_ROOT_DIR");

let (major, minor): (usize, usize) = if cfg!(feature = "cuda-12050") {
let (major, minor): (usize, usize) = if cfg!(feature = "cuda-12060") {
(12, 6)
} else if cfg!(feature = "cuda-12050") {
(12, 5)
} else if cfg!(feature = "cuda-12040") {
(12, 4)
Expand All @@ -30,7 +32,7 @@ fn main() {
(11, 4)
} 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, cuda-11060, cuda-11050, cuda-11040]");
panic!("Must specify one of the following features: [cuda-version-from-build-system, cuda-12060, cuda-12050, cuda-12040, cuda-12030, cuda-12020, cuda-12010, cuda-12000, cuda-11080, cuda-11070, cuda-11060, cuda-11050, cuda-11040]");

#[cfg(feature = "cuda-version-from-build-system")]
{
Expand Down Expand Up @@ -68,6 +70,7 @@ fn cuda_version_from_build_system() -> (usize, usize) {
let version_number = release_section.split(' ').nth(1).unwrap();

match version_number {
"12.6" => (12, 6),
"12.5" => (12, 5),
"12.4" => (12, 4),
"12.3" => (12, 3),
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 @@ -53,6 +53,11 @@ mod sys_12050;
#[cfg(feature = "cuda-12050")]
pub use sys_12050::*;

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

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