elementwise_binary_execute#

nvmath.bindings.cutensor.elementwise_binary_execute(
intptr_t handle,
intptr_t plan,
intptr_t alpha,
intptr_t a,
intptr_t gamma,
intptr_t c,
intptr_t d,
intptr_t stream,
)[source]#

Performs an element-wise tensor operation for two input tensors (see cutensorcreateElementwiseBinary).

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

  • plan (intptr_t) – Opaque handle holding all information about the desired elementwise operation (created by cutensorcreateElementwiseBinary followed by cutensorcreatePlan).

  • alpha (intptr_t) – Scaling factor for a (see cutensorOperationdescriptorGetattribute(desc, cUTENSOR_OPERaTION_ScaLaR_TYPE) to query the expected data type). Pointer to the host memory. If alpha is zero, a is not read and the corresponding unary operator is not applied.

  • a (intptr_t) – Multi-mode tensor (described by desca as part of cutensorcreateElementwiseBinary). Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to d.

  • gamma (intptr_t) – Scaling factor for c (see cutensorOperationdescriptorGetattribute(desc, cUTENSOR_OPERaTION_ScaLaR_TYPE) to query the expected data type). Pointer to the host memory. If gamma is zero, c is not read and the corresponding unary operator is not applied.

  • c (intptr_t) – Multi-mode tensor (described by descc as part of cutensorcreateElementwiseBinary). Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to d.

  • d (intptr_t) – Multi-mode tensor (described by descd as part of cutensorcreateElementwiseBinary). Pointer to the GPU-accessible memory (c and d may be identical, if and only if descc == descd).

  • stream (intptr_t) – The cUda stream used to perform the operation.

See also

cutensorElementwiseBinaryExecute