Skip to main content

cutensorMpCreateContraction

Function cutensorMpCreateContraction 

Source
pub unsafe extern "C" fn cutensorMpCreateContraction(
    handle: cutensorMpHandle_t,
    desc: *mut cutensorMpOperationDescriptor_t,
    descA: cutensorMpTensorDescriptor_t,
    modesA: *const i32,
    opA: cutensorOperator_t,
    descB: cutensorMpTensorDescriptor_t,
    modesB: *const i32,
    opB: cutensorOperator_t,
    descC: cutensorMpTensorDescriptor_t,
    modesC: *const i32,
    opC: cutensorOperator_t,
    descD: cutensorMpTensorDescriptor_t,
    modesD: *const i32,
    descCompute: cutensorComputeDescriptor_t,
) -> cutensorStatus_t
Expand description

Creates an operation descriptor that encodes a distributed tensor contraction.

This function creates an operation descriptor for distributed tensor contractions of the form $D = \alpha \mathcal{A} \mathcal{B} + \beta \mathcal{C}$, where the tensors A, B, C, and D are distributed across multiple processes as specified by their respective tensor descriptors.

The distributed contraction leverages both intra-process cuTENSOR operations and inter-process communication to efficiently compute tensor contractions that exceed the memory capacity or computational resources of a single GPU. The operation automatically handles data redistribution, local contractions, and result aggregation across the participating processes.

The user is responsible for calling cutensorMpDestroyOperationDescriptor to free the resources associated with the descriptor once it is no longer needed.

Remark

non-blocking, no reentrant, and thread-safe.

§Parameters

  • handle: Opaque handle holding cutensorMp’s library context.
  • desc: Pointer to the operation descriptor that will be created and filled with information encoding the distributed contraction operation.
  • descA: Distributed tensor descriptor for input tensor A.
  • modesA: Modes of the input tensor A.
  • opA: Unary operator that will be applied to each element of A before it is further processed. The original data of this tensor remains unchanged.
  • descB: Distributed tensor descriptor for input tensor B.
  • modesB: Modes of the input tensor B.
  • opB: Unary operator that will be applied to each element of B before it is further processed. The original data of this tensor remains unchanged.
  • descC: Distributed tensor descriptor for input tensor C.
  • modesC: Modes of the input tensor C.
  • opC: Unary operator that will be applied to each element of C before it is further processed. The original data of this tensor remains unchanged.
  • descD: Distributed tensor descriptor for output tensor D (currently must be identical to descC).
  • modesD: Modes of the output tensor D.
  • descCompute: Compute descriptor that determines the precision for the operation.

§Return value