Merge pull request #2616 from rust-lang/gpu-example-update

Add the gpu version of the kernel which was missing in the docs
This commit is contained in:
Manuel Drehwald
2025-10-24 03:11:16 +02:00
committed by GitHub

View File

@@ -56,6 +56,13 @@ fn main() {
unsafe extern "C" {
pub fn kernel_1(array_b: *mut [f64; 256]);
}
#[cfg(not(target_os = "linux"))]
#[unsafe(no_mangle)]
#[inline(never)]
pub extern "gpu-kernel" fn kernel_1(x: *mut [f64; 256]) {
unsafe { (*x)[0] = 21.0 };
}
```
## Compile instructions