pub struct PitchedBuffer<T: DeviceRepr> { /* private fields */ }Expand description
A pitched device allocation — a 2-D height × width_in_bytes block
where each row is stored at pitch bytes apart (pitch >= width_in_bytes).
Pitch is chosen by the driver to satisfy hardware alignment requirements.
Implementations§
Source§impl<T: DeviceRepr> PitchedBuffer<T>
impl<T: DeviceRepr> PitchedBuffer<T>
Sourcepub fn new(context: &Context, width_elems: usize, height: usize) -> Result<Self>
pub fn new(context: &Context, width_elems: usize, height: usize) -> Result<Self>
Allocate a height × width_elems grid of Ts with driver-chosen
pitch. The element size hint steers the alignment.
pub fn width_elems(&self) -> usize
pub fn height(&self) -> usize
Sourcepub fn pitch_bytes(&self) -> usize
pub fn pitch_bytes(&self) -> usize
Row stride in bytes as chosen by the driver.
pub fn as_raw(&self) -> CUdeviceptr
pub fn context(&self) -> &Context
Trait Implementations§
Source§impl<T: DeviceRepr> Debug for PitchedBuffer<T>
impl<T: DeviceRepr> Debug for PitchedBuffer<T>
Source§impl<T: DeviceRepr> Drop for PitchedBuffer<T>
impl<T: DeviceRepr> Drop for PitchedBuffer<T>
impl<T: DeviceRepr + Send> Send for PitchedBuffer<T>
Auto Trait Implementations§
impl<T> Freeze for PitchedBuffer<T>
impl<T> RefUnwindSafe for PitchedBuffer<T>where
T: RefUnwindSafe,
impl<T> Sync for PitchedBuffer<T>where
T: Sync,
impl<T> Unpin for PitchedBuffer<T>where
T: Unpin,
impl<T> UnsafeUnpin for PitchedBuffer<T>
impl<T> UnwindSafe for PitchedBuffer<T>where
T: UnwindSafe,
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