pub enum KernelArg<'a> {
Buffer(DevicePtr),
Bytes(&'a [u8]),
}Expand description
2026-09-25: A typed kernel argument for launch_typed. The Metal backend
binds buffers with setBuffer:offset:atIndex: and bytes with
setBytes:length:atIndex:; CUDA packs both into parameter slots.
Variants§
Buffer(DevicePtr)
2026-09-25: A device address. The Metal backend resolves it to its
owning MTLBuffer and offset; CUDA passes the u64 as is.
Bytes(&'a [u8])
2026-09-25: Scalar or struct bytes, passed by value. CUDA packs them into
8-byte slots, zero-padding the last (pack_kernel_args).
Trait Implementations§
impl<'a> Copy for KernelArg<'a>
Auto Trait Implementations§
impl<'a> Freeze for KernelArg<'a>
impl<'a> RefUnwindSafe for KernelArg<'a>
impl<'a> Send for KernelArg<'a>
impl<'a> Sync for KernelArg<'a>
impl<'a> Unpin for KernelArg<'a>
impl<'a> UnwindSafe for KernelArg<'a>
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