pub unsafe extern "C" fn cutensorElementwiseBinaryExecute(
handle: cutensorHandle_t,
plan: cutensorPlan_t,
alpha: *const c_void,
A: *const c_void,
gamma: *const c_void,
C: *const c_void,
D: *mut c_void,
stream: cudaStream_t,
) -> cutensorStatus_tExpand description
Performs an element-wise tensor operation for two input tensors (see cutensorCreateElementwiseBinary)
This function performs a element-wise tensor operation of the form: $$ D_{\Pi^C(i_0,i_1,…,i_n)} = \Phi_{AC}(\alpha op_A(A_{\Pi^A(i_0,i_1,…,i_n)}), \gamma op_C(C_{\Pi^C(i_0,i_1,…,i_n)})) $$
See cutensorCreateElementwiseBinary for details.
Remark
calls asynchronous functions, no reentrant, and thread-safe.
§Parameters
handle: Opaque handle holding cuTENSOR’s library context.plan: Opaque handle holding all information about the desired elementwise operation (created bycutensorCreateElementwiseBinaryfollowed bycutensorCreatePlan).alpha: 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: Multi-mode tensor (described bydescAas part ofcutensorCreateElementwiseBinary). Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to D.gamma: 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: Multi-mode tensor (described bydescCas part ofcutensorCreateElementwiseBinary). Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to D.D: Multi-mode tensor (described bydescDas part ofcutensorCreateElementwiseBinary). Pointer to the GPU-accessible memory (CandDmay be identical, if and only ifdescC == descD).stream: The CUDA stream used to perform the operation.
§Return value
cutensorStatus_t::CUTENSOR_STATUS_INVALID_VALUE: if tensor dimensions or modes have an illegal value.cutensorStatus_t::CUTENSOR_STATUS_NOT_INITIALIZED: if the handle is not initialized.cutensorStatus_t::CUTENSOR_STATUS_NOT_SUPPORTED: if the combination of data types or operations is not supported.cutensorStatus_t::CUTENSOR_STATUS_SUCCESS: The operation completed successfully without error.