pub struct MockThread {
pub thread_idx: (u32, u32, u32),
pub block_idx: (u32, u32, u32),
pub block_dim: (u32, u32, u32),
pub grid_dim: (u32, u32, u32),
pub warp_id: u32,
pub lane_id: u32,
pub warp_size: u32,
}Expand description
Mock thread context providing GPU intrinsics.
Fields§
§thread_idx: (u32, u32, u32)Thread index within block (x, y, z).
block_idx: (u32, u32, u32)Block index within grid (x, y, z).
block_dim: (u32, u32, u32)Block dimensions.
grid_dim: (u32, u32, u32)Grid dimensions.
warp_id: u32Warp ID (within block).
lane_id: u32Lane ID (within warp).
warp_size: u32Warp size.
Implementations§
Source§impl MockThread
impl MockThread
Sourcepub fn new(
thread_idx: (u32, u32, u32),
block_idx: (u32, u32, u32),
config: &MockKernelConfig,
) -> Self
pub fn new( thread_idx: (u32, u32, u32), block_idx: (u32, u32, u32), config: &MockKernelConfig, ) -> Self
Create a new mock thread.
Sourcepub fn thread_idx_x(&self) -> u32
pub fn thread_idx_x(&self) -> u32
Get thread index X.
Sourcepub fn thread_idx_y(&self) -> u32
pub fn thread_idx_y(&self) -> u32
Get thread index Y.
Sourcepub fn thread_idx_z(&self) -> u32
pub fn thread_idx_z(&self) -> u32
Get thread index Z.
Sourcepub fn block_idx_x(&self) -> u32
pub fn block_idx_x(&self) -> u32
Get block index X.
Sourcepub fn block_idx_y(&self) -> u32
pub fn block_idx_y(&self) -> u32
Get block index Y.
Sourcepub fn block_idx_z(&self) -> u32
pub fn block_idx_z(&self) -> u32
Get block index Z.
Sourcepub fn block_dim_x(&self) -> u32
pub fn block_dim_x(&self) -> u32
Get block dimension X.
Sourcepub fn block_dim_y(&self) -> u32
pub fn block_dim_y(&self) -> u32
Get block dimension Y.
Sourcepub fn block_dim_z(&self) -> u32
pub fn block_dim_z(&self) -> u32
Get block dimension Z.
Sourcepub fn grid_dim_x(&self) -> u32
pub fn grid_dim_x(&self) -> u32
Get grid dimension X.
Sourcepub fn grid_dim_y(&self) -> u32
pub fn grid_dim_y(&self) -> u32
Get grid dimension Y.
Sourcepub fn grid_dim_z(&self) -> u32
pub fn grid_dim_z(&self) -> u32
Get grid dimension Z.
Sourcepub fn is_block_leader(&self) -> bool
pub fn is_block_leader(&self) -> bool
Check if this is the first thread in the block.
Sourcepub fn is_warp_leader(&self) -> bool
pub fn is_warp_leader(&self) -> bool
Check if this is the first thread in the warp.
Trait Implementations§
Source§impl Clone for MockThread
impl Clone for MockThread
Source§fn clone(&self) -> MockThread
fn clone(&self) -> MockThread
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 moreAuto Trait Implementations§
impl Freeze for MockThread
impl RefUnwindSafe for MockThread
impl Send for MockThread
impl Sync for MockThread
impl Unpin for MockThread
impl UnwindSafe for MockThread
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.