Skip to content

Commit f845278

Browse files
committed
Update README
1 parent 75bcfaf commit f845278

File tree

3 files changed

+31
-18
lines changed

3 files changed

+31
-18
lines changed

Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ members = [
1111

1212
[workspace.package]
1313
edition = "2021"
14-
version = "6.2.2003"
14+
version = "6.2.2004"
1515
license = "MIT OR Apache-2.0"
1616
readme = "README.md"
1717

README.md

Lines changed: 28 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ Here is the table of currently available bindings:
5555
|:-------------|:------------|:---------------|:----------------------|
5656
| 6.2.2 | rocm__6_2_2 | cubecl-hip-sys | 6.2.2003 |
5757
| 6.2.4 | rocm__6_2_4 | cubecl-hip-sys | 6.2.4001 |
58+
| 6.3.0 | rocm__6_3_0 | cubecl-hip-sys | 6.3.0000 |
5859

5960
Here is a table of the libraries covered by each crate:
6061

@@ -86,44 +87,56 @@ tested version.
8687
and `Usage` sections.
8788

8889
2) Generate the bindings using the dedicated xtask command `bindgen`. For instance, to generate
89-
the bindings for the crate `cubecl-hip-sys` and the ROCm version `6.2.4`:
90+
the bindings for the crate `cubecl-hip-sys` and the ROCm version `6.3.0`:
9091

9192
```sh
92-
cargo xtask bindgen -c cubecl-hip-sys -v 6.2.4
93+
cargo xtask bindgen -c cubecl-hip-sys -v 6.3.0
9394
```
9495

95-
3) Declare a new feature in the `Cargo.toml` of the corresponding crate `cubecl-hip-sys` with
96-
the format `rocm__<version>` where `<version>` is the ROCm version with `_` separator. For
97-
instance for the version `6.2.4`:
96+
3) If the HIP bindings patch version has changed, declare a new `hip` feature in the `Cargo.toml`
97+
of the corresponding crate `cubecl-hip-sys` with the format `hip_<patch_version>`. For instance
98+
the version `6.3.0` has a new HIP patch version which is `42131`. Is the patch version did not
99+
change then skip this step.
98100

99101
```toml
100102
[features]
101-
rocm__6_2_4 = []
103+
hip_42131 = []
102104
```
103105

104-
4) Replace the default feature in the `Cargo.toml` file be the latest one, in this case `rocm__6_2_4`.
106+
4) Declare a new `rocm` feature in the `Cargo.toml` of the corresponding crate `cubecl-hip-sys`
107+
with the format `rocm__<version>` where `<version>` is the ROCm version with `_` separator and
108+
add a dependency on its corresponding HIP bindings patch version. Note that sometimes the HIP
109+
bindings are not changed between two version of ROCm, in this case reuse the already existing
110+
hip feature.
105111

106112
```toml
107113
[features]
108-
default = ["rocm__6_2_4"]
114+
rocm__6_3_0 = [ "hip_42131" ]
115+
```
116+
117+
4) Replace the default feature in the `Cargo.toml` file be the latest one, in this case `rocm__6_3_0`.
118+
119+
```toml
120+
[features]
121+
default = ["rocm__6_3_0"]
109122
```
110123

111124
5) Add the generated bindings module to the file `crates/cubecl-hip-sys/src/bindings/mod.rs`
112125
conditionally to the new feature you just declared as well as the re-exports:
113126

114127
```rs
115-
#[cfg(feature = "rocm__6_2_4")]
116-
mod bindings_624;
117-
#[cfg(feature = "rocm__6_2_4")]
118-
pub use bindings_624::*;
128+
#[cfg(feature = "hip_42131")]
129+
mod bindings_42131;
130+
#[cfg(feature = "hip_42131")]
131+
pub use bindings_42131::*;
119132
```
120133

121-
6) Run the tests as explain in the previous section. Use the new feature you just created.
122-
Currently there is no test selection mechanism in place given a ROCm version. If there are
123-
errors you can use conditional attributes for now.
134+
6) Run the tests as explain in the previous section using the new feature you just created.
124135

125136
7) Open a pull request with the modifications, do not forget to add the new generated bindings
126137
file in the `crates/cubecl-hip-sys/src/bindings/` directory.
127138

139+
8) Note that the CI runner might need to be updated by an administrator to install the new version of ROCm.
140+
128141
[1]: https://rocmdocs.amd.com/projects/install-on-linux/en/latest/install/detailed-install.html
129142
[2]: https://crates.io/crates/cubecl-hip-sys

0 commit comments

Comments
 (0)