pub struct ThreadContext {
pub thread_idx: Dim3,
pub block_idx: Dim3,
pub block_dim: Dim3,
pub grid_dim: Dim3,
}
Expand description
Thread context provided to kernels
Fields§
§thread_idx: Dim3
Thread index within block
block_idx: Dim3
Block index within grid
block_dim: Dim3
Block dimensions
grid_dim: Dim3
Grid dimensions
Implementations§
Source§impl ThreadContext
impl ThreadContext
Sourcepub fn global_thread_id(&self) -> usize
pub fn global_thread_id(&self) -> usize
Get global thread ID (1D)
Sourcepub fn global_thread_id_2d(&self) -> (usize, usize)
pub fn global_thread_id_2d(&self) -> (usize, usize)
Get global thread ID (2D)
Sourcepub fn global_thread_id_3d(&self) -> (usize, usize, usize)
pub fn global_thread_id_3d(&self) -> (usize, usize, usize)
Get global thread ID (3D)
Trait Implementations§
Source§impl Clone for ThreadContext
impl Clone for ThreadContext
Source§fn clone(&self) -> ThreadContext
fn clone(&self) -> ThreadContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ThreadContext
impl Debug for ThreadContext
impl Copy for ThreadContext
Auto Trait Implementations§
impl Freeze for ThreadContext
impl RefUnwindSafe for ThreadContext
impl Send for ThreadContext
impl Sync for ThreadContext
impl Unpin for ThreadContext
impl UnwindSafe for ThreadContext
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