[−][src]Struct accel::module::Grid
Size of Grid (grid of blocks) 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 grid1d = Grid::x(64); assert_eq!(grid1d.x, 64); let grid2d = Grid::xy(64, 128); assert_eq!(grid2d.x, 64); assert_eq!(grid2d.y, 128); let grid3d = Grid::xyz(64, 128, 256); assert_eq!(grid3d.x, 64); assert_eq!(grid3d.y, 128); assert_eq!(grid3d.z, 256);
- From single integer (unsigned and signed)
let grid1d: Grid = 64_usize.into(); assert_eq!(grid1d.x, 64); let grid1d: Grid = 64_i32.into(); assert_eq!(grid1d.x, 64);
- From tuple
let grid1d: Grid = (64,).into(); assert_eq!(grid1d.x, 64); let grid2d: Grid = (64, 128).into(); assert_eq!(grid2d.x, 64); assert_eq!(grid2d.y, 128); let grid3d: Grid = (64, 128, 256).into(); assert_eq!(grid3d.x, 64); assert_eq!(grid3d.y, 128); assert_eq!(grid3d.z, 256);
Fields
x: u32
y: u32
z: u32
Implementations
impl Grid
[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 Grid
[src]
impl Copy for Grid
[src]
impl Debug for Grid
[src]
impl<I: ToPrimitive> Into<Grid> for (I,)
[src]
impl<I1: ToPrimitive, I2: ToPrimitive> Into<Grid> for (I1, I2)
[src]
impl Into<Grid> for i16
[src]
impl Into<Grid> for i32
[src]
impl Into<Grid> for i64
[src]
impl Into<Grid> for i128
[src]
impl Into<Grid> for isize
[src]
impl<I1: ToPrimitive, I2: ToPrimitive, I3: ToPrimitive> Into<Grid> for (I1, I2, I3)
[src]
impl Into<Grid> for u8
[src]
impl Into<Grid> for u16
[src]
impl Into<Grid> for u32
[src]
impl Into<Grid> for u64
[src]
impl Into<Grid> for u128
[src]
impl Into<Grid> for usize
[src]
impl Into<Grid> for i8
[src]
impl PartialEq<Grid> for Grid
[src]
impl PartialOrd<Grid> for Grid
[src]
fn partial_cmp(&self, other: &Grid) -> Option<Ordering>
[src]
fn lt(&self, other: &Grid) -> bool
[src]
fn le(&self, other: &Grid) -> bool
[src]
fn gt(&self, other: &Grid) -> bool
[src]
fn ge(&self, other: &Grid) -> bool
[src]
impl StructuralPartialEq for Grid
[src]
Auto Trait Implementations
impl RefUnwindSafe for Grid
impl Send for Grid
impl Sync for Grid
impl Unpin for Grid
impl UnwindSafe for Grid
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>,