pub struct KernelLauncher<R: Runtime> {
pub settings: KernelSettings,
/* private fields */
}Expand description
Prepare a kernel for launch.
Fields§
§settings: KernelSettingsImplementations§
Source§impl<R: Runtime> KernelLauncher<R>
impl<R: Runtime> KernelLauncher<R>
Sourcepub fn register_tensor(&mut self, tensor: &TensorArg<'_, R>)
pub fn register_tensor(&mut self, tensor: &TensorArg<'_, R>)
Register a tensor to be launched.
Sourcepub fn register_tensor_map(&mut self, tensor: &TensorMapArg<'_, R>)
pub fn register_tensor_map(&mut self, tensor: &TensorMapArg<'_, R>)
Register a mapped tensor to be launched.
Sourcepub fn register_array(&mut self, array: &ArrayArg<'_, R>)
pub fn register_array(&mut self, array: &ArrayArg<'_, R>)
Register an input array to be launched.
Sourcepub fn register_scalar<C: CubeScalar>(&mut self, scalar: C)
pub fn register_scalar<C: CubeScalar>(&mut self, scalar: C)
Register a scalar to be launched.
Sourcepub fn register_scalar_raw(&mut self, bytes: &[u8], dtype: StorageType)
pub fn register_scalar_raw(&mut self, bytes: &[u8], dtype: StorageType)
Register a scalar to be launched from raw data.
Sourcepub fn launch<K: CubeKernel>(
self,
cube_count: CubeCount,
kernel: K,
client: &ComputeClient<R>,
) -> Result<(), LaunchError>
pub fn launch<K: CubeKernel>( self, cube_count: CubeCount, kernel: K, client: &ComputeClient<R>, ) -> Result<(), LaunchError>
Launch the kernel.
Sourcepub unsafe fn launch_unchecked<K: CubeKernel>(
self,
cube_count: CubeCount,
kernel: K,
client: &ComputeClient<R>,
) -> Result<(), LaunchError>
pub unsafe fn launch_unchecked<K: CubeKernel>( self, cube_count: CubeCount, kernel: K, client: &ComputeClient<R>, ) -> Result<(), LaunchError>
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.
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for KernelLauncher<R>
impl<R> RefUnwindSafe for KernelLauncher<R>where
R: RefUnwindSafe,
impl<R> Send for KernelLauncher<R>
impl<R> Sync for KernelLauncher<R>
impl<R> Unpin for KernelLauncher<R>where
R: Unpin,
impl<R> UnwindSafe for KernelLauncher<R>where
R: UnwindSafe,
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