You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG]: #[device] extern fn leaves an undefined symbol in a cdylib #1800
A cdylib whose kernel calls a #[device] unsafe extern "C" fn cannot be loaded. The cdylib exports the #[no_mangle] host copy of every #[kernel] and #[device] fn, so that copy's call to the device-only symbol stays undefined in the host library. An executable links because the linker drops the unexported host copies.
nm -D shows U scale, referenced by the exported T cuda_oxide_codegen_v1_cuda_oxide_kernel_246e25db_apply_scale.
Expected behavior
The library loads; scale exists only in the device link.
Minimal reproduction example
// src/lib.rsuse cuda_device::{device, kernel};#[device]unsafeextern"C"{// Defined only in external LTOIR linked at device link time.fnscale(x:f32) -> f32;}#[kernel]pubfnapply_scale(out:*mutf32){unsafe{*out = scale(*out)};}
Activity