pub struct DeviceBuffer2D<T: Copy> {
pub width: usize,
pub height: usize,
pub num_channels: usize,
pub pitch: usize,
/* private fields */
}
Expand description
Synchronous implementation of crate::DeviceBuffer2D
.
Refer to crate::DeviceBuffer2D
for documentation.
Fields§
§width: usize
§height: usize
§num_channels: usize
§pitch: usize
Implementations§
Source§impl<T: Copy> DeviceBuffer2D<T>
impl<T: Copy> DeviceBuffer2D<T>
pub fn new(width: usize, height: usize, num_channels: usize) -> Self
Sourcepub unsafe fn copy_from_async(
&mut self,
other: &HostBuffer<T>,
stream: &Stream,
) -> Result<(), Error>
pub unsafe fn copy_from_async( &mut self, other: &HostBuffer<T>, stream: &Stream, ) -> Result<(), Error>
Copy from host buffer.
§Safety
This function is marked unsafe because it does not synchronize and the operation might not have completed when it returns.
Sourcepub unsafe fn copy_to_async(
&self,
other: &mut HostBuffer<T>,
stream: &Stream,
) -> Result<(), Error>
pub unsafe fn copy_to_async( &self, other: &mut HostBuffer<T>, stream: &Stream, ) -> Result<(), Error>
Copy to host buffer.
§Safety
This function is marked unsafe because it does not synchronize and the operation might not have completed when it returns.
Sourcepub fn fill_with_byte(
&mut self,
value: u8,
stream: &Stream,
) -> Result<(), Error>
pub fn fill_with_byte( &mut self, value: u8, stream: &Stream, ) -> Result<(), Error>
Fill buffer with byte value.
pub fn num_elements(&self) -> usize
Sourcepub fn as_internal(&self) -> &DevicePtr
pub fn as_internal(&self) -> &DevicePtr
Get readonly reference to internal DevicePtr
.
Sourcepub fn as_mut_internal(&mut self) -> &mut DevicePtr
pub fn as_mut_internal(&mut self) -> &mut DevicePtr
Get mutable reference to internal DevicePtr
.
Trait Implementations§
Source§impl<T: Copy> Drop for DeviceBuffer2D<T>
impl<T: Copy> Drop for DeviceBuffer2D<T>
impl<T: Copy> Send for DeviceBuffer2D<T>
Implements Send
for DeviceBuffer2D
.
§Safety
This property is inherited from the CUDA API, which is thread-safe.
impl<T: Copy> Sync for DeviceBuffer2D<T>
Implements Sync
for DeviceBuffer2D
.
§Safety
This property is inherited from the CUDA API, which is thread-safe.
Auto Trait Implementations§
impl<T> Freeze for DeviceBuffer2D<T>
impl<T> RefUnwindSafe for DeviceBuffer2D<T>where
T: RefUnwindSafe,
impl<T> Unpin for DeviceBuffer2D<T>where
T: Unpin,
impl<T> UnwindSafe for DeviceBuffer2D<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