pub struct KernelLauncher<R: Runtime> {
pub settings: KernelSettings,
pub scope: Scope,
/* private fields */
}Expand description
Prepare a kernel for launch.
Fields§
§settings: KernelSettings§scope: ScopeImplementations§
Source§impl<R: Runtime> KernelLauncher<R>
impl<R: Runtime> KernelLauncher<R>
pub fn with_scope<T>(&mut self, fun: impl FnMut(&mut Scope) -> T) -> T
Sourcepub fn register_scalar<C: ScalarArgType>(&mut self, scalar: C)
pub fn register_scalar<C: ScalarArgType>(&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>,
)
pub fn launch<K: CubeKernel>( self, cube_count: CubeCount, kernel: K, client: &ComputeClient<R>, )
Launch the kernel.
Sourcepub unsafe fn launch_unchecked<K: CubeKernel>(
self,
cube_count: CubeCount,
kernel: K,
client: &ComputeClient<R>,
)
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>
impl<R: Runtime> KernelLauncher<R>
Sourcepub fn register_tensor(&mut self, tensor: TensorArg<R>, ty: Type)
pub fn register_tensor(&mut self, tensor: TensorArg<R>, ty: Type)
Push a new input tensor to the state.
Sourcepub fn register_array(&mut self, array: ArrayArg<R>, ty: Type)
pub fn register_array(&mut self, array: ArrayArg<R>, ty: Type)
Push a new input array to the state.
Sourcepub fn register_tensor_map<K: TensorMapKind>(
&mut self,
map: TensorMapArg<R, K>,
ty: Type,
)
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>
impl<R: Runtime> KernelLauncher<R>
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> 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