Skip to content

Commit

Permalink
New version 6.2.2001
Browse files Browse the repository at this point in the history
rename feature rocm_622 to rocm__6_2_2
  • Loading branch information
syl20bnr committed Dec 9, 2024
1 parent c63b693 commit 7162418
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ members = [

[workspace.package]
edition = "2021"
version = "6.2.4000"
version = "6.2.2001"
license = "MIT OR Apache-2.0"
readme = "README.md"

Expand Down
2 changes: 1 addition & 1 deletion crates/cubecl-hip-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ version.workspace = true
rust-version = "1.81"

[features]
default = ["rocm__6_2_4"]
default = ["rocm__6_2_2"]
rocm__6_2_2 = []
rocm__6_2_4 = []

Expand Down
15 changes: 11 additions & 4 deletions crates/cubecl-hip-sys/build.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use std::{env, io};
use std::path::Path;
use std::{env, io};

const ROCM_FEATURE_PREFIX: &str = "CARGO_FEATURE_ROCM__";

Expand Down Expand Up @@ -32,7 +32,11 @@ fn get_system_hip_version(rocm_path: impl AsRef<Path>) -> std::io::Result<(u8, u
println!("cargo::warning=Unknown release version for patch version {system_patch}. This patch does not correspond to an official release patch.");
}

Ok((system_major, system_minor, release_patch.unwrap_or(system_patch)))
Ok((
system_major,
system_minor,
release_patch.unwrap_or(system_patch),
))
}

/// The official patch number of a ROCm release is not the same of the patch number
Expand Down Expand Up @@ -79,12 +83,15 @@ fn ensure_single_rocm_feature_set() {

for (key, value) in env::vars() {
if key.starts_with(ROCM_FEATURE_PREFIX) && value == "1" {
enabled_features.push(format!("rocm__{}", key.strip_prefix(ROCM_FEATURE_PREFIX).unwrap()));
enabled_features.push(format!(
"rocm__{}",
key.strip_prefix(ROCM_FEATURE_PREFIX).unwrap()
));
}
}

match enabled_features.len() {
1 => {},
1 => {}
0 => panic!("No ROCm version features are enabled. One ROCm version feature must be set."),
_ => panic!(
"Multiple ROCm version features are enabled: {:?}. Only one can be set.",
Expand Down

0 comments on commit 7162418

Please sign in to comment.