Skip to main content

Module tensor

Module tensor 

Source
Expand description

TensorActor — wraps cuTENSOR for contractions, reductions, permutations, and binary/trinary elementwise ops.

cuTENSOR’s safe cudarc::cutensor::result layer covers contractions and reductions only. The remaining ops drop down to cudarc::cutensor::sys via the local crate::sys::cutensor wrappers.

The actor is a single mailbox carrying TensorMsg::Op(Box<dyn TensorDispatch>). Each typed request — ContractRequest<T>, ReductionRequest<T>, ElementwiseBinaryRequest<T>, ElementwiseTrinaryRequest<T>, PermutationRequest<T> — implements TensorDispatch so it erases through a single mailbox without mailbox-per-dtype blowup.

Re-exports§

pub use compute_desc::ComputeDesc;
pub use contract::ContractRequest;
pub use contract::OperandSpec;
pub use elementwise::ElementwiseBinaryRequest;
pub use elementwise::ElementwiseTrinaryRequest;
pub use permute::PermutationRequest;
pub use plan_cache::PlanCache;
pub use plan_cache::PlanKey;
pub use plan_cache::DEFAULT_PLAN_CACHE_SIZE;
pub use reduce::ReductionRequest;

Modules§

compute_desc
Mixed-precision compute descriptors used by every cuTENSOR op.
contract
ContractRequest<T> — dtype-generic Einstein-summation contraction.
elementwise
ElementwiseBinaryRequest<T> and ElementwiseTrinaryRequest<T>.
permute
PermutationRequest<T> — dtype-generic mode permutation.
plan_cache
LRU plan cache for cuTENSOR operations.
reduce
ReductionRequest<T> — dtype-generic tensor reduction.

Structs§

SendHandle
Newtype around cutensorHandle_t so it can be stored in Arc<Mutex>. Manually Send/Sync because the wrapped pointer is opaque and cuTENSOR’s docs guarantee thread-safety of the handle when callers serialise access (the Mutex does that).
TensorActor

Enums§

TensorMsg
TensorActor mailbox. New requests should use TensorMsg::Op with a Box<dyn TensorDispatch> — the Contract variant is kept as a deprecated thin alias for back-compat with the F-phase API.

Type Aliases§

TensorSpec
Pre-Phase-2 spec: alias of OperandSpec<f32> so existing call sites (tests/contract_e2e.rs, downstream users) keep compiling. New code should prefer OperandSpec<T> directly.