pub struct PrintfBuffer { /* private fields */ }Expand description
GPU-side printf emulation buffer.
The buffer layout is a simple framed protocol:
[entry_count: u32_le]
repeated entry_count times:
[thread_x: u32_le] [thread_y: u32_le] [thread_z: u32_le]
[block_x: u32_le] [block_y: u32_le] [block_z: u32_le]
[fmt_len: u32_le] [fmt_bytes: u8 * fmt_len]
[arg_count: u32_le]
repeated arg_count times:
[tag: u8] 0=Int(i64_le), 1=Float(f64_le), 2=String(u32_le len + bytes)Implementations§
Source§impl PrintfBuffer
impl PrintfBuffer
Sourcepub fn new(buffer_size: usize) -> Self
pub fn new(buffer_size: usize) -> Self
Create a printf buffer descriptor with the given maximum size.
Sourcepub fn buffer_size(&self) -> usize
pub fn buffer_size(&self) -> usize
Returns the configured buffer size.
Sourcepub fn parse_entries(&self, raw: &[u8]) -> Vec<PrintfEntry>
pub fn parse_entries(&self, raw: &[u8]) -> Vec<PrintfEntry>
Parse a raw byte buffer into structured printf entries.
Returns an empty vec if the buffer is too small or malformed.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PrintfBuffer
impl RefUnwindSafe for PrintfBuffer
impl Send for PrintfBuffer
impl Sync for PrintfBuffer
impl Unpin for PrintfBuffer
impl UnsafeUnpin for PrintfBuffer
impl UnwindSafe for PrintfBuffer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more