pub unsafe extern "C" fn cutensorPermute(
handle: cutensorHandle_t,
plan: cutensorPlan_t,
alpha: *const c_void,
A: *const c_void,
B: *mut c_void,
stream: cudaStream_t,
) -> cutensorStatus_tExpand description
Performs the tensor permutation that is encoded by plan (see cutensorCreatePermutation).
This function performs an elementwise tensor operation of the form: $$ B_{\Pi^B(i_0,i_1,…,i_n)} = \alpha op_A(A_{\Pi^A(i_0,i_1,…,i_n)}) $$
Consequently, this function performs an out-of-place tensor permutation.
Where
- A and B are multi-mode tensors (of arbitrary data types),
- $\Pi^A, \Pi^B$ are permutation operators that permute the modes of A, B respectively,
- $op_A$ is an unary element-wise operators (e.g., IDENTITY, SQR, CONJUGATE), and is specified when creating the operation descriptor using
cutensorCreatePermutation
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 tensor reduction (created bycutensorCreatePermutationfollowed bycutensorCreatePlan).alpha: Scaling factor for A (see cutensorOperationDescriptorGetAttribute(desc, CUTENSOR_OPERATION_SCALAR_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 of type typeA with nmodeA modes. Pointer to the GPU-accessible memory. The data accessed via this pointer must not overlap with the elements written to D.B: Multi-mode tensor of type typeB with nmodeB modes. Pointer to the GPU-accessible memory.stream: The CUDA stream.
§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.