[][src]Function core::arch::nvptx::vprintf

pub unsafe extern "C" fn vprintf(
    format: *const u8,
    valist: *const c_void
) -> i32
🔬 This is a nightly-only experimental API. (stdsimd #48556)
This is supported on target_arch="nvptx" or target_arch="nvptx64" only.

Print formatted output from a kernel to a host-side output stream.

Syscall arguments:

#[repr(C)]
struct PrintArgs(f32, f32, f32, i32);

vprintf(
    "int(%f + %f) = int(%f) = %d\n".as_ptr(),
    transmute(&PrintArgs(a, b, a + b, (a + b) as i32)),
);
Run

Sources: Programming Guide, PTX Interoperability.