Function vprintf
pub unsafe extern "C" fn vprintf(format: *const u8, valist: *const c_void) -> i32
Print formatted output from a kernel to a host-side output stream.
Syscall arguments:
status: The status value that is returned byvprintf.format: A pointer to the format specifier input (uses commonprintfformat).valist: A pointer to the valist input.
# use std::mem::transmute;
#[repr(C)]
struct PrintArgs(f32, f32, f32, i32);
let a = 0.1f32;
let b = 0.2f32;
vprintf(
"int(%f + %f) = int(%f) = %d\n".as_ptr(),
transmute(&PrintArgs(a, b, a + b, (a + b) as i32)),
);
Sources: Programming Guide, PTX Interoperability.