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