Skip to main content

LaunchBuilder

Struct LaunchBuilder 

Source
pub struct LaunchBuilder<'k> { /* private fields */ }
Expand description

Builder produced by Kernel::launch.

Implementations§

Source§

impl<'k> LaunchBuilder<'k>

Source

pub fn grid(self, grid: impl Into<Dim3>) -> Self

Source

pub fn block(self, block: impl Into<Dim3>) -> Self

Source

pub fn shared_mem_bytes(self, bytes: usize) -> Self

Source

pub fn stream(self, stream: &'k Stream) -> Self

Source

pub fn arg<K: KernelArg>(self, arg: K) -> Self

Source

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.

Source

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.

Trait Implementations§

Source§

impl Debug for LaunchBuilder<'_>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'k> Freeze for LaunchBuilder<'k>

§

impl<'k> RefUnwindSafe for LaunchBuilder<'k>

§

impl<'k> !Send for LaunchBuilder<'k>

§

impl<'k> !Sync for LaunchBuilder<'k>

§

impl<'k> Unpin for LaunchBuilder<'k>

§

impl<'k> UnsafeUnpin for LaunchBuilder<'k>

§

impl<'k> UnwindSafe for LaunchBuilder<'k>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.