Skip to content

Commit aa7b035

Browse files
authored
Add arm64 to CI (#255)
This varies by arch. Rather than hardcoding which, we'll just allow here.
1 parent 3f0759a commit aa7b035

File tree

3 files changed

+33
-12
lines changed

3 files changed

+33
-12
lines changed

.github/workflows/ci_linux.yml

Lines changed: 30 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
jobs:
2424
build:
2525
name: Build / ${{ matrix.variance.name }}
26-
runs-on: ubuntu-latest
26+
runs-on: ${{ matrix.variance.runner }}
2727
container:
2828
image: ${{ matrix.variance.image }}
2929
strategy:
@@ -32,12 +32,22 @@ jobs:
3232
variance:
3333
# - name: Ubuntu-22.04/CUDA-11.8.0
3434
# image: "ghcr.io/rust-gpu/rust-cuda-ubuntu22-cuda11:latest"
35-
- name: Ubuntu-22.04 / CUDA-12.8.1
35+
# runner: ubuntu-latest
36+
- name: Ubuntu-22.04 / CUDA-12.8.1 / x86_64
37+
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu22-cuda12:latest"
38+
runner: ubuntu-latest
39+
- name: Ubuntu-22.04 / CUDA-12.8.1 / ARM64
3640
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu22-cuda12:latest"
37-
- name: Ubuntu-24.04 / CUDA-12.8.1
41+
runner: ubuntu-22.04-arm
42+
- name: Ubuntu-24.04 / CUDA-12.8.1 / x86_64
3843
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu24-cuda12:latest"
39-
- name: RockyLinux-9 / CUDA-12.8.1
44+
runner: ubuntu-latest
45+
- name: Ubuntu-24.04 / CUDA-12.8.1 / ARM64
46+
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu24-cuda12:latest"
47+
runner: ubuntu-24.04-arm
48+
- name: RockyLinux-9 / CUDA-12.8.1 / x86_64
4049
image: "ghcr.io/rust-gpu/rust-cuda-rockylinux9-cuda12:latest"
50+
runner: ubuntu-latest
4151
outputs:
4252
# Output the result of the permission check
4353
actor_has_write_permission: ${{ steps.check_access.outputs.require-result }}
@@ -119,7 +129,7 @@ jobs:
119129
github.event_name == 'workflow_dispatch' ||
120130
(github.event_name == 'pull_request' && needs.build.outputs.actor_has_write_permission == 'true')
121131
)
122-
runs-on: ubuntu-latest
132+
runs-on: ${{ matrix.variance.runner }}
123133
# Use the exact same container image as the build job
124134
container:
125135
image: ${{ matrix.variance.image }}
@@ -129,14 +139,24 @@ jobs:
129139
matrix:
130140
variance:
131141
# Must match the build job's matrix definition
132-
# - name: Ubuntu-22.04 / CUDA-11.8.0 image:
133-
# "ghcr.io/rust-gpu/rust-cuda-ubuntu22-cuda11:latest"
134-
- name: Ubuntu-22.04 / CUDA-12.8.1
142+
# - name: Ubuntu-22.04 / CUDA-11.8.0
143+
# image: "ghcr.io/rust-gpu/rust-cuda-ubuntu22-cuda11:latest"
144+
# runner: ubuntu-latest
145+
- name: Ubuntu-22.04 / CUDA-12.8.1 / x86_64
146+
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu22-cuda12:latest"
147+
runner: ubuntu-latest
148+
- name: Ubuntu-22.04 / CUDA-12.8.1 / ARM64
135149
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu22-cuda12:latest"
136-
- name: Ubuntu-24.04 / CUDA-12.8.1
150+
runner: ubuntu-22.04-arm
151+
- name: Ubuntu-24.04 / CUDA-12.8.1 / x86_64
152+
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu24-cuda12:latest"
153+
runner: ubuntu-latest
154+
- name: Ubuntu-24.04 / CUDA-12.8.1 / ARM64
137155
image: "ghcr.io/rust-gpu/rust-cuda-ubuntu24-cuda12:latest"
138-
- name: RockyLinux-9 / CUDA-12.8.1
156+
runner: ubuntu-24.04-arm
157+
- name: RockyLinux-9 / CUDA-12.8.1 / x86_64
139158
image: "ghcr.io/rust-gpu/rust-cuda-rockylinux9-cuda12:latest"
159+
runner: ubuntu-latest
140160
steps:
141161
- name: Download build artifacts
142162
uses: actions/download-artifact@v4

crates/cust/src/device.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,7 @@ impl Device {
352352
unsafe {
353353
driver_sys::cuDeviceGetUuid(&mut cu_uuid, self.device).to_result()?;
354354
}
355+
#[allow(clippy::unnecessary_cast)]
355356
let uuid: [u8; 16] = cu_uuid.bytes.map(|byte| byte as u8);
356357
Ok(uuid)
357358
}

crates/rustc_codegen_nvvm/src/back.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,14 +131,14 @@ pub extern "C" fn demangle_callback(
131131
output_ptr: *mut c_char,
132132
output_len: size_t,
133133
) -> size_t {
134-
let input = unsafe { slice::from_raw_parts(input_ptr as *const u8, input_len) };
134+
let input = unsafe { slice::from_raw_parts(input_ptr.cast::<u8>(), input_len) };
135135

136136
let input = match std::str::from_utf8(input) {
137137
Ok(s) => s,
138138
Err(_) => return 0,
139139
};
140140

141-
let output = unsafe { slice::from_raw_parts_mut(output_ptr as *mut u8, output_len) };
141+
let output = unsafe { slice::from_raw_parts_mut(output_ptr.cast::<u8>(), output_len) };
142142
let mut cursor = io::Cursor::new(output);
143143

144144
let demangled = match rustc_demangle::try_demangle(input) {

0 commit comments

Comments
 (0)