contract_trinary#

nvmath.bindings.cutensor.contract_trinary(
intptr_t handle,
intptr_t plan,
intptr_t alpha,
intptr_t a,
intptr_t b,
intptr_t c,
intptr_t beta,
intptr_t d,
intptr_t e,
intptr_t workspace,
uint64_t workspace_size,
intptr_t stream,
)[source]#

This routine computes the tensor contraction .

Parameters:
  • handle (intptr_t) – Opaque handle holding cuTeNSOR’s library context.

  • plan (intptr_t) – Opaque handle holding the contraction execution plan (created by cutensorcreatecontractionTrinary followed by cutensorcreatePlan).

  • alpha (intptr_t) – Scaling for a*b*c. Its data type is determined by ‘desccompute’ (see cutensorOperationdescriptorGetattribute(desc, cUTeNSOR_OPeRaTION_ScaLaR_TYPe)). Pointer to the host memory.

  • a (intptr_t) – Pointer to the data corresponding to a. Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to e.

  • b (intptr_t) – Pointer to the data corresponding to b. Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to e.

  • c (intptr_t) – Pointer to the data corresponding to c. Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to e.

  • beta (intptr_t) – Scaling for d. Its data type is determined by ‘desccompute’ (see cutensorOperationdescriptorGetattribute(desc, cUTeNSOR_OPeRaTION_ScaLaR_TYPe)). Pointer to the host memory.

  • d (intptr_t) – Pointer to the data corresponding to d. Pointer to the GPU-accessible memory.

  • e (intptr_t) – Pointer to the data corresponding to e. Pointer to the GPU-accessible memory.

  • workspace (intptr_t) – Optional parameter that may be NULL. This pointer provides additional workspace, in device memory, to the library for additional optimizations; the workspace must be aligned to 256 bytes (i.e., the default alignment of cudaMalloc).

  • workspace_size (uint64_t) – Size of the workspace array in bytes; please refer to cutensorestimateWorkspaceSize to query the required workspace. While cutensorcontract does not strictly require a workspace for the contraction, it is still recommended to provided some small workspace (e.g., 128 Mb).

  • stream (intptr_t) – The cUda stream in which all the computation is performed.

See also

cutensorContractTrinary