pub struct LaunchBuilder<'k> { /* private fields */ }Expand description
Builder produced by Kernel::launch.
Implementations§
Source§impl<'k> LaunchBuilder<'k>
impl<'k> LaunchBuilder<'k>
Sourcepub fn grid(self, grid: impl Into<Dim3>) -> Self
pub fn grid(self, grid: impl Into<Dim3>) -> Self
Set the grid dimensions (number of thread blocks).
Sourcepub fn block(self, block: impl Into<Dim3>) -> Self
pub fn block(self, block: impl Into<Dim3>) -> Self
Set the block dimensions (threads per block).
Reserve bytes of dynamic shared memory per block.
Sourcepub fn stream(self, stream: &'k Stream) -> Self
pub fn stream(self, stream: &'k Stream) -> Self
Enqueue on stream instead of the default stream.
Sourcepub fn arg<K: KernelArg>(self, arg: K) -> Self
pub fn arg<K: KernelArg>(self, arg: K) -> Self
Append arg to the kernel argument list. Arguments are passed
positionally in the order they are added.
Sourcepub unsafe fn launch(self) -> Result<()>
pub unsafe fn launch(self) -> Result<()>
Enqueue the kernel.
§Safety
Same rules as [baracuda_driver::LaunchBuilder::launch]: argument
types and order must match the kernel’s C signature, referenced
device memory must stay valid for the duration of device execution,
and grid/block dims must be within device limits.
Sourcepub unsafe fn launch_cooperative(self) -> Result<()>
pub unsafe fn launch_cooperative(self) -> Result<()>
Launch as a cooperative kernel — grid-wide sync via
cooperative_groups::this_grid(). All blocks must fit resident
on the device simultaneously; use
crate::Kernel::max_active_blocks_per_multiprocessor to size
the grid.
§Safety
Same as launch plus the kernel must be
compiled with cooperative-groups support.