pub struct Memcpy3DParams {
pub src_pitch: usize,
pub dst_pitch: usize,
pub width: usize,
pub height: usize,
pub depth: usize,
pub src_height: usize,
pub dst_height: usize,
}Expand description
Parameters for a 3D (volumetric) memory copy.
3D copies extend the 2D pitched model with a depth dimension.
The source and destination are conceptually 3D arrays where each
2D “slice” has its own pitch, and slices are separated by
pitch * slice_height bytes.
Fields§
§src_pitch: usizeBytes per row in the source (including padding).
dst_pitch: usizeBytes per row in the destination (including padding).
width: usizeBytes of actual data to copy per row.
height: usizeNumber of rows per slice to copy.
depth: usizeNumber of slices (depth) to copy.
src_height: usizeHeight of the source allocation (rows per slice, including any padding rows). Used to compute the byte stride between slices.
dst_height: usizeHeight of the destination allocation (rows per slice).
Implementations§
Source§impl Memcpy3DParams
impl Memcpy3DParams
Sourcepub fn new(
src_pitch: usize,
dst_pitch: usize,
width: usize,
height: usize,
depth: usize,
src_height: usize,
dst_height: usize,
) -> Self
pub fn new( src_pitch: usize, dst_pitch: usize, width: usize, height: usize, depth: usize, src_height: usize, dst_height: usize, ) -> Self
Creates new 3D copy parameters.
Sourcepub fn validate(&self) -> CudaResult<()>
pub fn validate(&self) -> CudaResult<()>
Validates the parameters.
Checks that width <= both pitches, height <= both allocation heights, and all dimensions are non-zero.
§Errors
Returns CudaError::InvalidValue if any constraint is violated.
Sourcepub fn src_slice_stride(&self) -> usize
pub fn src_slice_stride(&self) -> usize
Returns the source byte stride between 2D slices.
Sourcepub fn dst_slice_stride(&self) -> usize
pub fn dst_slice_stride(&self) -> usize
Returns the destination byte stride between 2D slices.
Sourcepub fn src_byte_extent(&self) -> usize
pub fn src_byte_extent(&self) -> usize
Returns the total source byte extent for the 3D region.
Sourcepub fn dst_byte_extent(&self) -> usize
pub fn dst_byte_extent(&self) -> usize
Returns the total destination byte extent for the 3D region.
Trait Implementations§
Source§impl Clone for Memcpy3DParams
impl Clone for Memcpy3DParams
Source§fn clone(&self) -> Memcpy3DParams
fn clone(&self) -> Memcpy3DParams
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more