Skip to main content

TensorMap

Struct TensorMap 

Source
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

Source

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 the DataType::* 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().

Source

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.

Source

pub fn as_raw(&self) -> &CUtensorMap

Raw pointer to the 128-byte descriptor — pass this to kernels that take a CUtensorMap parameter.

Source

pub fn as_raw_mut(&mut self) -> &mut CUtensorMap

Mutable raw access (for FFI calls that want *mut CUtensorMap).

Trait Implementations§

Source§

impl Debug for TensorMap

Source§

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

Formats the value using the given formatter. Read more

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