Skip to main content

Handle

Struct Handle 

Source
pub struct Handle { /* private fields */ }
Expand description

cuTENSOR library handle.

Implementations§

Source§

impl Handle

Source

pub fn new() -> Result<Self>

Create a new cuTENSOR handle (cutensorCreate).

Source

pub fn as_raw(&self) -> cutensorHandle_t

Raw cutensorHandle_t. Use with care.

Source

pub fn resize_plan_cache(&self, num_entries: u32) -> Result<()>

Resize the internal plan cache — larger = more cached plans, faster re-invocations. Default is 64.

Source

pub fn write_plan_cache_to_file(&self, path: &str) -> Result<()>

Persist the plan cache to disk.

Source

pub fn read_plan_cache_from_file(&self, path: &str) -> Result<()>

Read a previously-written plan cache from disk.

Source

pub fn write_kernel_cache_to_file(&self, path: &str) -> Result<()>

Persist the kernel cache (compiled binary kernels) to disk. Separate from plan cache — kernel cache survives across planner changes.

Source

pub fn read_kernel_cache_from_file(&self, path: &str) -> Result<()>

Read a previously-written kernel cache from disk.

Source

pub fn compute_desc_32f(&self) -> Result<*const c_void>

Fetch cuTENSOR’s pre-defined CUTENSOR_COMPUTE_DESC_32F descriptor. Pass this (or one of the sibling accessors) as compute_desc to any op constructor.

Source

pub fn compute_desc_64f(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_64F — double-precision accumulator.

Source

pub fn compute_desc_16f(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_16F — half-precision accumulator.

Source

pub fn compute_desc_16bf(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_16BF — bf16 accumulator.

Source

pub fn compute_desc_tf32(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_TF32 — TF32 tensor-core accumulator.

Source

pub fn compute_desc_3xtf32(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_3XTF32 — 3xTF32 emulation for f32.

Source

pub fn compute_desc_4x16f(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_4X16F — 4x f16 mixed-precision.

Source

pub fn compute_desc_8xint8(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_8XINT8 — packed int8 tensor cores.

Source

pub fn compute_desc_9x16bf(&self) -> Result<*const c_void>

Fetch CUTENSOR_COMPUTE_DESC_9X16BF — bf16 stochastic-rounding mode.

Trait Implementations§

Source§

impl Debug for Handle

Source§

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

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

impl Drop for Handle

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Send for Handle

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.