pub struct CUarrayMapInfo {
pub resource_type: c_int,
pub resource_raw: u64,
pub subresource_type: c_int,
pub subresource_raw: [u64; 4],
pub mem_operation_type: c_int,
pub mem_handle_type: c_int,
pub mem_handle_raw: u64,
pub offset: u64,
pub device_bit_mask: c_uint,
pub flags: c_uint,
pub reserved: [c_uint; 2],
/* private fields */
}Expand description
CUarrayMapInfo — 96-byte descriptor for cuMemMapArrayAsync.
Three tagged unions in one struct (resource / subresource / memHandle). The typed builder methods below populate them correctly; raw field access is available for advanced users.
Layout (CUDA 13.x):
struct CUarrayMapInfo {
CUresourcetype resourceType; // offset 0, 4 bytes
// 4 bytes pad
union { CUmipmappedArray; CUarray; } resource; // offset 8, 8 bytes
CUarraySparseSubresourceType subresourceType; // offset 16, 4 bytes
// 4 bytes pad
union { // offset 24, 32 bytes
struct { u32 level, layer, ox, oy, oz, ew, eh, ed; } sparseLevel;
struct { u32 layer; u64 offset; u64 size; } miptail;
} subresource;
CUmemOperationType memOperationType; // offset 56, 4 bytes
CUmemHandleType memHandleType; // offset 60, 4 bytes
union { CUmemGenericAllocationHandle; } memHandle; // offset 64, 8 bytes
u64 offset; // offset 72, 8 bytes
u32 deviceBitMask; // offset 80, 4 bytes
u32 flags; // offset 84, 4 bytes
u32 reserved[2]; // offset 88, 8 bytes
};Fields§
§resource_type: c_int§resource_raw: u64Union payload: CUarray or CUmipmappedArray (both pointer-sized).
subresource_type: c_int§subresource_raw: [u64; 4]Union payload for the subresource (32 bytes, enough for
sparseLevel’s 8 u32s or miptail’s 3-field struct).
mem_operation_type: c_int§mem_handle_type: c_int§mem_handle_raw: u64§offset: u64§device_bit_mask: c_uint§flags: c_uint§reserved: [c_uint; 2]Implementations§
Source§impl CUarrayMapInfo
impl CUarrayMapInfo
Sourcepub fn with_array(self, array: CUarray) -> Self
pub fn with_array(self, array: CUarray) -> Self
Point the resource union at a CUarray handle.
Sourcepub fn with_mipmapped_array(self, mipmap: CUmipmappedArray) -> Self
pub fn with_mipmapped_array(self, mipmap: CUmipmappedArray) -> Self
Point the resource union at a CUmipmappedArray handle.
Sourcepub fn with_sparse_level(
self,
level: u32,
layer: u32,
offset_x: u32,
offset_y: u32,
offset_z: u32,
extent_width: u32,
extent_height: u32,
extent_depth: u32,
) -> Self
pub fn with_sparse_level( self, level: u32, layer: u32, offset_x: u32, offset_y: u32, offset_z: u32, extent_width: u32, extent_height: u32, extent_depth: u32, ) -> Self
Set the subresource to a sparse-level tile update. offset_*
and extent_* are in tiles (not bytes).
Sourcepub fn with_miptail(self, layer: u32, tail_offset: u64, tail_size: u64) -> Self
pub fn with_miptail(self, layer: u32, tail_offset: u64, tail_size: u64) -> Self
Set the subresource to a mipmap-tail update.
Sourcepub fn with_mem_handle(self, handle: CUmemGenericAllocationHandle) -> Self
pub fn with_mem_handle(self, handle: CUmemGenericAllocationHandle) -> Self
Set the mem-handle union to a VMM generic allocation handle.
Sourcepub fn with_offset(self, offset: u64) -> Self
pub fn with_offset(self, offset: u64) -> Self
Byte offset into the backing allocation handle.
Sourcepub fn with_device_bit_mask(self, mask: u32) -> Self
pub fn with_device_bit_mask(self, mask: u32) -> Self
Bitmask of devices the mapping applies to (one bit per peer).
Trait Implementations§
Source§impl Clone for CUarrayMapInfo
impl Clone for CUarrayMapInfo
Source§fn clone(&self) -> CUarrayMapInfo
fn clone(&self) -> CUarrayMapInfo
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more