Files
rust/compiler/rustc_codegen_llvm/src
Stuart Cook 2b150f2c65 Rollup merge of #147936 - Sa4dUs:offload-intrinsic, r=ZuseZ4
Offload intrinsic

This PR implements the minimal mechanisms required to run a small subset of arbitrary offload kernels without relying on hardcoded names or metadata.

- `offload(kernel, (..args))`: an intrinsic that generates the necessary host-side LLVM-IR code.
- `rustc_offload_kernel`: a builtin attribute that marks device kernels to be handled appropriately.

Example usage (pseudocode):
```rust
fn kernel(x: *mut [f64; 128]) {
    core::intrinsics::offload(kernel_1, (x,))
}

#[cfg(target_os = "linux")]
extern "C" {
    pub fn kernel_1(array_b: *mut [f64; 128]);
}

#[cfg(not(target_os = "linux"))]
#[rustc_offload_kernel]
extern "gpu-kernel" fn kernel_1(x: *mut [f64; 128]) {
    unsafe { (*x)[0] = 21.0 };
}
```
2025-11-26 23:32:03 +11:00
..
2025-11-25 20:04:27 +01:00
2025-11-25 20:04:27 +01:00
2025-11-11 18:34:47 -05:00
2025-10-15 20:06:46 -04:00
2025-11-04 21:27:22 -05:00
2025-11-25 20:04:27 +01:00
2025-11-25 20:04:27 +01:00
2025-11-25 20:04:27 +01:00
2025-11-11 18:55:40 -05:00
2025-11-04 21:27:22 -05:00
2025-11-11 18:22:38 -05:00