pub struct ThreadIdOperation<'c> { /* private fields */ }Expand description
A thread_id operation.
Returns the thread id, i.e. the index of the current thread within the block
along the x, y, or z dimension.
Example:
%tIdX = gpu.thread_id xIf upper_bound is set, or if one can be inferred from known_block_size-type
annotations in context, executions where the thread index would be greater
than or equal to that bound cause undefined behavior.
There is an implicit upper bound of kMaxDim (currently uint32_t::max).
Implementations§
Source§impl<'c> ThreadIdOperation<'c>
impl<'c> ThreadIdOperation<'c>
Sourcepub fn as_operation(&self) -> &Operation<'c>
pub fn as_operation(&self) -> &Operation<'c>
Returns a generic operation.
Sourcepub fn builder(
context: &'c Context,
location: Location<'c>,
) -> ThreadIdOperationBuilder<'c, Unset>
pub fn builder( context: &'c Context, location: Location<'c>, ) -> ThreadIdOperationBuilder<'c, Unset>
Creates a builder.
pub fn dimension(&self) -> Result<Attribute<'c>, Error>
pub fn set_dimension(&mut self, value: Attribute<'c>)
pub fn upper_bound(&self) -> Result<IntegerAttribute<'c>, Error>
pub fn set_upper_bound(&mut self, value: IntegerAttribute<'c>)
pub fn remove_upper_bound(&mut self) -> Result<(), Error>
Trait Implementations§
Source§impl<'c> Clone for ThreadIdOperation<'c>
impl<'c> Clone for ThreadIdOperation<'c>
Source§fn clone(&self) -> ThreadIdOperation<'c>
fn clone(&self) -> ThreadIdOperation<'c>
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<'c> Debug for ThreadIdOperation<'c>
impl<'c> Debug for ThreadIdOperation<'c>
Source§impl<'b> From<ThreadIdOperation<'b>> for GpuDialectOperation<'b>
impl<'b> From<ThreadIdOperation<'b>> for GpuDialectOperation<'b>
Source§fn from(op: ThreadIdOperation<'b>) -> Self
fn from(op: ThreadIdOperation<'b>) -> Self
Converts to this type from the input type.
Source§impl<'c> From<ThreadIdOperation<'c>> for Operation<'c>
impl<'c> From<ThreadIdOperation<'c>> for Operation<'c>
Source§fn from(operation: ThreadIdOperation<'c>) -> Self
fn from(operation: ThreadIdOperation<'c>) -> Self
Converts to this type from the input type.
Source§impl<'c> PartialEq for ThreadIdOperation<'c>
impl<'c> PartialEq for ThreadIdOperation<'c>
Source§impl<'c> TryFrom<Operation<'c>> for ThreadIdOperation<'c>
impl<'c> TryFrom<Operation<'c>> for ThreadIdOperation<'c>
impl<'c> Eq for ThreadIdOperation<'c>
impl<'c> StructuralPartialEq for ThreadIdOperation<'c>
Auto Trait Implementations§
impl<'c> Freeze for ThreadIdOperation<'c>
impl<'c> RefUnwindSafe for ThreadIdOperation<'c>
impl<'c> !Send for ThreadIdOperation<'c>
impl<'c> !Sync for ThreadIdOperation<'c>
impl<'c> Unpin for ThreadIdOperation<'c>
impl<'c> UnwindSafe for ThreadIdOperation<'c>
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