From ae6a72bda5c4a832dffca82dd69686f5e95d87ba Mon Sep 17 00:00:00 2001 From: Manuel Drehwald Date: Fri, 24 Oct 2025 03:09:24 +0200 Subject: [PATCH] Add the gpu version of the kernel which was missing in the docs --- src/offload/usage.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/offload/usage.md b/src/offload/usage.md index 9f519984d..7d1a5c9e2 100644 --- a/src/offload/usage.md +++ b/src/offload/usage.md @@ -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