[−][src]Struct accel::module::Block
Size of Block (thread block) in CUDA thread hierarchy
Every input integer and float convert into u32
using ToPrimitive.
If the conversion is impossible, e.g. negative or too large integers, the conversion will panics.
Examples
- Explicit creation
let block1d = Block::x(64); assert_eq!(block1d.x, 64); let block2d = Block::xy(64, 128); assert_eq!(block2d.x, 64); assert_eq!(block2d.y, 128); let block3d = Block::xyz(64, 128, 256); assert_eq!(block3d.x, 64); assert_eq!(block3d.y, 128); assert_eq!(block3d.z, 256);
- From single integer (unsigned and signed)
let block1d: Block = 64_usize.into(); assert_eq!(block1d.x, 64); let block1d: Block = 64_i32.into(); assert_eq!(block1d.x, 64);
- From tuple
let block1d: Block = (64,).into(); assert_eq!(block1d.x, 64); let block2d: Block = (64, 128).into(); assert_eq!(block2d.x, 64); assert_eq!(block2d.y, 128); let block3d: Block = (64, 128, 256).into(); assert_eq!(block3d.x, 64); assert_eq!(block3d.y, 128); assert_eq!(block3d.z, 256);
Fields
x: u32
y: u32
z: u32
Implementations
impl Block
[src]
pub fn x<I: ToPrimitive>(x: I) -> Self
[src]
pub fn xy<I1: ToPrimitive, I2: ToPrimitive>(x: I1, y: I2) -> Self
[src]
pub fn xyz<I1: ToPrimitive, I2: ToPrimitive, I3: ToPrimitive>(
x: I1,
y: I2,
z: I3
) -> Self
[src]
x: I1,
y: I2,
z: I3
) -> Self
Trait Implementations
impl Clone for Block
[src]
impl Copy for Block
[src]
impl Debug for Block
[src]
impl<I: ToPrimitive> Into<Block> for (I,)
[src]
impl<I1: ToPrimitive, I2: ToPrimitive> Into<Block> for (I1, I2)
[src]
impl Into<Block> for i16
[src]
impl Into<Block> for i32
[src]
impl Into<Block> for i64
[src]
impl Into<Block> for i128
[src]
impl Into<Block> for isize
[src]
impl<I1: ToPrimitive, I2: ToPrimitive, I3: ToPrimitive> Into<Block> for (I1, I2, I3)
[src]
impl Into<Block> for u8
[src]
impl Into<Block> for u16
[src]
impl Into<Block> for u32
[src]
impl Into<Block> for u64
[src]
impl Into<Block> for u128
[src]
impl Into<Block> for usize
[src]
impl Into<Block> for i8
[src]
impl PartialEq<Block> for Block
[src]
impl PartialOrd<Block> for Block
[src]
fn partial_cmp(&self, other: &Block) -> Option<Ordering>
[src]
fn lt(&self, other: &Block) -> bool
[src]
fn le(&self, other: &Block) -> bool
[src]
fn gt(&self, other: &Block) -> bool
[src]
fn ge(&self, other: &Block) -> bool
[src]
impl StructuralPartialEq for Block
[src]
Auto Trait Implementations
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnwindSafe for Block
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,