contract#
-
nvmath.
bindings. cutensor. contract( - intptr_t handle,
- intptr_t plan,
- intptr_t alpha,
- intptr_t a,
- intptr_t b,
- intptr_t beta,
- intptr_t c,
- intptr_t d,
- intptr_t workspace,
- uint64_t workspace_size,
- intptr_t stream,
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
cutensorcreatecontractionfollowed bycutensorcreatePlan).alpha (intptr_t) – Scaling for a*b. 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 d.
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 d.
beta (intptr_t) – Scaling for c. Its data type is determined by ‘desccompute’ (see cutensorOperationdescriptorGetattribute(desc, cUTENSOR_OPERaTION_ScaLaR_TYPE)). Pointer to the host memory.
c (intptr_t) – Pointer to the data corresponding to c. Pointer to the GPU-accessible memory.
d (intptr_t) – Pointer to the data corresponding to d. 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
cutensorEstimateWorkspaceSizeto query the required workspace. Whilecutensorcontractdoes 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
cutensorContract