Skip to main content

CUarrayMapInfo

Struct CUarrayMapInfo 

Source
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: u64

Union 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

Source

pub fn with_array(self, array: CUarray) -> Self

Point the resource union at a CUarray handle.

Source

pub fn with_mipmapped_array(self, mipmap: CUmipmappedArray) -> Self

Point the resource union at a CUmipmappedArray handle.

Source

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).

Source

pub fn with_miptail(self, layer: u32, tail_offset: u64, tail_size: u64) -> Self

Set the subresource to a mipmap-tail update.

Source

pub fn with_mem_handle(self, handle: CUmemGenericAllocationHandle) -> Self

Set the mem-handle union to a VMM generic allocation handle.

Source

pub fn as_map(self) -> Self

Mark this entry as a map operation.

Source

pub fn as_unmap(self) -> Self

Mark this entry as an unmap operation.

Source

pub fn with_offset(self, offset: u64) -> Self

Byte offset into the backing allocation handle.

Source

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

Source§

fn clone(&self) -> CUarrayMapInfo

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for CUarrayMapInfo

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for CUarrayMapInfo

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Copy for CUarrayMapInfo

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.