pub struct KernelContext {
pub thread_idx: Dim3,
pub block_idx: Dim3,
pub block_dim: Dim3,
pub grid_dim: Dim3,
pub barrier: Option<Arc<Barrier>>,
}Expand description
Kernel execution context that mirrors CUDA’s built-in variables.
Each thread in a kernel launch receives its own KernelContext via
thread-local storage, providing access to threadIdx, blockIdx,
blockDim, and gridDim equivalents.
Fields§
§thread_idx: Dim3Thread index within the block (analogous to CUDA threadIdx)
block_idx: Dim3Block index within the grid (analogous to CUDA blockIdx)
block_dim: Dim3Dimensions of each block (analogous to CUDA blockDim)
grid_dim: Dim3Dimensions of the grid (analogous to CUDA gridDim)
barrier: Option<Arc<Barrier>>Optional barrier for sync_threads() synchronisation within a block
Trait Implementations§
Source§impl Clone for KernelContext
impl Clone for KernelContext
Source§fn clone(&self) -> KernelContext
fn clone(&self) -> KernelContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for KernelContext
impl RefUnwindSafe for KernelContext
impl Send for KernelContext
impl Sync for KernelContext
impl Unpin for KernelContext
impl UnsafeUnpin for KernelContext
impl UnwindSafe for KernelContext
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