Skip to main content

KernelLauncher

Struct KernelLauncher 

Source
pub struct KernelLauncher<R: Runtime> {
    pub settings: KernelSettings,
    pub scope: Scope,
    /* private fields */
}
Expand description

Prepare a kernel for launch.

Fields§

§settings: KernelSettings§scope: Scope

Implementations§

Source§

impl<R: Runtime> KernelLauncher<R>

Source

pub fn with_scope<T>(&mut self, fun: impl FnMut(&mut Scope) -> T) -> T

Source

pub fn register_scalar<C: ScalarArgType>(&mut self, scalar: C)

Register a scalar to be launched.

Source

pub fn register_scalar_raw(&mut self, bytes: &[u8], dtype: StorageType)

Register a scalar to be launched from raw data.

Source

pub fn launch<K: CubeKernel>( self, cube_count: CubeCount, kernel: K, client: &ComputeClient<R>, )

Launch the kernel.

Source

pub unsafe fn launch_unchecked<K: CubeKernel>( self, cube_count: CubeCount, kernel: K, client: &ComputeClient<R>, )

Launch the kernel without check bounds.

§Safety

The kernel must not:

  • Contain any out of bounds reads or writes. Doing so is immediate UB.
  • Contain any loops that never terminate. These may be optimized away entirely or cause other unpredictable behaviour.
Source§

impl<R: Runtime> KernelLauncher<R>

Source

pub fn register_tensor(&mut self, tensor: TensorArg<R>, ty: Type)

Push a new input tensor to the state.

Source

pub fn register_array(&mut self, array: ArrayArg<R>, ty: Type)

Push a new input array to the state.

Source

pub fn register_tensor_map<K: TensorMapKind>( &mut self, map: TensorMapArg<R, K>, ty: Type, )

Push a new tensor to the state.

Source§

impl<R: Runtime> KernelLauncher<R>

Source

pub fn new(settings: KernelSettings) -> Self

Auto Trait Implementations§

§

impl<R> Freeze for KernelLauncher<R>

§

impl<R> !RefUnwindSafe for KernelLauncher<R>

§

impl<R> !Send for KernelLauncher<R>

§

impl<R> !Sync for KernelLauncher<R>

§

impl<R> Unpin for KernelLauncher<R>
where R: Unpin,

§

impl<R> UnsafeUnpin for KernelLauncher<R>

§

impl<R> !UnwindSafe for KernelLauncher<R>

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> IntoComptime for T

Source§

fn comptime(self) -> Self

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.