pub struct TensorMap { /* private fields */ }Expand description
A 128-byte Hopper TMA descriptor. Pass to a kernel as a __grid_constant__
parameter of type CUtensorMap for use with TMA instructions.
Implementations§
Source§impl TensorMap
impl TensorMap
Sourcepub fn encode_tiled(
data_type: i32,
global_base: CUdeviceptr,
global_dim: &[u64],
global_strides: &[u64],
box_dim: &[u32],
element_strides: &[u32],
interleave: i32,
swizzle: i32,
l2_promotion: i32,
oob_fill: i32,
) -> Result<Self>
pub fn encode_tiled( data_type: i32, global_base: CUdeviceptr, global_dim: &[u64], global_strides: &[u64], box_dim: &[u32], element_strides: &[u32], interleave: i32, swizzle: i32, l2_promotion: i32, oob_fill: i32, ) -> Result<Self>
Build a tiled TMA descriptor.
data_type: element type (one of theDataType::*constants).global_base: pointer to the first element of the tensor.global_dim: per-axis size of the global tensor (innermost-to-outermost).global_strides: per-axis byte strides between successive elements.box_dim: per-axis shape of the tile copied at a time.element_strides: per-axis element-strides (typically all 1).
All arrays must have length rank = global_dim.len().
Sourcepub fn replace_address(&mut self, new_base: CUdeviceptr) -> Result<()>
pub fn replace_address(&mut self, new_base: CUdeviceptr) -> Result<()>
Swap the global base address of an existing descriptor in place.
Lets you reuse one TensorMap across multiple buffers of the same
shape/stride.
Sourcepub fn as_raw(&self) -> &CUtensorMap
pub fn as_raw(&self) -> &CUtensorMap
Raw pointer to the 128-byte descriptor — pass this to kernels that
take a CUtensorMap parameter.
Sourcepub fn as_raw_mut(&mut self) -> &mut CUtensorMap
pub fn as_raw_mut(&mut self) -> &mut CUtensorMap
Mutable raw access (for FFI calls that want *mut CUtensorMap).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TensorMap
impl RefUnwindSafe for TensorMap
impl Send for TensorMap
impl Sync for TensorMap
impl Unpin for TensorMap
impl UnsafeUnpin for TensorMap
impl UnwindSafe for TensorMap
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