pub unsafe extern "C" fn cutensorElementwiseTrinaryExecute(
handle: cutensorHandle_t,
plan: cutensorPlan_t,
alpha: *const c_void,
A: *const c_void,
beta: *const c_void,
B: *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 three input tensors (see cutensorCreateElementwiseTrinary)
This function performs a element-wise tensor operation of the form: $$ D_{\Pi^C(i_0,i_1,…,i_n)} = \Phi_{ABC}(\Phi_{AB}(\alpha op_A(A_{\Pi^A(i_0,i_1,…,i_n)}), \beta op_B(B_{\Pi^B(i_0,i_1,…,i_n)})), \gamma op_C(C_{\Pi^C(i_0,i_1,…,i_n)})) $$
See cutensorCreateElementwiseTrinary 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 bycutensorCreateElementwiseTrinaryfollowed 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 ofcutensorCreateElementwiseTrinary). Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to D.beta: Scaling factor for B (see cutensorOperationDescriptorGetAttribute(desc, CUTENSOR_OPERATION_SCALAR_TYPE) to query the expected data type). Pointer to the host memory. If beta is zero, B is not read and the corresponding unary operator is not applied.B: Multi-mode tensor (described bydescBas part ofcutensorCreateElementwiseTrinary). 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 ofcutensorCreateElementwiseTrinary). 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 ofcutensorCreateElementwiseTrinary). 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.