pub struct Array { /* private fields */ }Expand description
A 2-D / 3-D CUDA array handle.
Implementations§
Source§impl Array
impl Array
Sourcepub fn new_2d(
desc: &cudaChannelFormatDesc,
width: usize,
height: usize,
flags: u32,
) -> Result<Self>
pub fn new_2d( desc: &cudaChannelFormatDesc, width: usize, height: usize, flags: u32, ) -> Result<Self>
Allocate a 2-D array width × height with the given channel
descriptor. flags = 0 for the default layout.
Sourcepub fn new_3d(
desc: &cudaChannelFormatDesc,
extent: cudaExtent,
flags: u32,
) -> Result<Self>
pub fn new_3d( desc: &cudaChannelFormatDesc, extent: cudaExtent, flags: u32, ) -> Result<Self>
Allocate a 3-D array with the given extent + descriptor.
flags = 0 for the default.
Sourcepub unsafe fn from_raw(
handle: cudaArray_t,
desc: cudaChannelFormatDesc,
width: usize,
height: usize,
depth: usize,
) -> Self
pub unsafe fn from_raw( handle: cudaArray_t, desc: cudaChannelFormatDesc, width: usize, height: usize, depth: usize, ) -> Self
Wrap an already-allocated cudaArray_t.
§Safety
handle must be a live CUDA array. The wrapper frees it on drop.
pub fn as_raw(&self) -> cudaArray_t
pub fn width(&self) -> usize
pub fn height(&self) -> usize
pub fn depth(&self) -> usize
pub fn desc(&self) -> &cudaChannelFormatDesc
Sourcepub fn info(&self) -> Result<(cudaChannelFormatDesc, cudaExtent, u32)>
pub fn info(&self) -> Result<(cudaChannelFormatDesc, cudaExtent, u32)>
Query the runtime-reported channel desc + extent.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Array
impl RefUnwindSafe for Array
impl Send for Array
impl Sync for Array
impl Unpin for Array
impl UnsafeUnpin for Array
impl UnwindSafe for Array
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