Table of Contents

Namespace NVMathNet.Tensor

Classes

ElementwiseBinary

Element-wise binary operation: D[modeD] = opAC(alpha · opA(A[modeA]), gamma · opC(C[modeC])).

ElementwiseTrinary

Stateful cuTENSOR element-wise trinary operation wrapper. Computes: D[modeD] = opABC(alpha * opA(A)[modeA], opAB(beta * opB(B)[modeB], gamma * opC(C)[modeC]))

Common use-cases include fused add/multiply of three same-shape tensors, e.g. D = alpha * A + beta * B + gamma * C (using NVMathNet.Interop.CuTensorOperator.Add for both binary ops).

Workflow:

  1. Construct with tensor descriptors and operator choices.
  2. Call NVMathNet.Tensor.ElementwiseTrinary.ExecuteAsync(System.IntPtr,System.IntPtr,System.IntPtr,System.IntPtr,System.Double,System.Double,System.Double,System.Threading.CancellationToken) to perform the operation.
  3. Dispose (or use await using) to free CUDA resources.
TensorContraction

Stateful cuTENSOR contraction wrapper. Mirrors the design of nvmath.tensor.TensorContraction:

  1. Construct with tensor descriptors.
  2. Call NVMathNet.Tensor.TensorContraction.PlanAsync(System.Threading.CancellationToken) to build the plan and select an algorithm.
  3. Call NVMathNet.Tensor.TensorContraction.ExecuteAsync(System.IntPtr,System.IntPtr,System.IntPtr,System.IntPtr,System.Double,System.Double,System.Threading.CancellationToken) to perform the contraction.
  4. Dispose to release CUDA resources.

Computes: D[modeD] = alpha * A[modeA] * B[modeB] + beta * C[modeC]

TensorContractionOptions

Options for a tensor contraction operation.

TensorOperation

Common plumbing for the single-plan cuTENSOR operations (permutation, element-wise binary, reduction): handle, stream, tensor descriptors, plan, workspace and disposal. Tensors use a packed column-major layout: the first mode varies fastest in memory.

TensorPermutation

Tensor permutation (generalised transpose): B[modeB] = alpha · opA(A[modeA]). The B mode labels must be a reordering of the A mode labels.

TensorReduction

Reduction: D[modeD] = alpha · opReduce(opA(A[modeA])) + beta · opC(C[modeD]), reducing the modes of A that do not appear in D.

Enums

ContractionAutotuneMode

Controls the algorithm search strategy used when building a tensor contraction plan.

TensorAlgorithm

Algorithm selection hint for tensor contraction.

TensorDataType

Data types supported by cuTENSOR operations.

WorksizePreference

Workspace size preference hint for cuTENSOR.