Matrix Operations#

Transpose#

#include <raft/linalg/transpose.cuh>

namespace raft::linalg

template<typename T, typename IndexType, typename LayoutPolicy, typename AccessorPolicy>
auto transpose(raft::resources const &handle, raft::mdspan<T, raft::matrix_extent<IndexType>, LayoutPolicy, AccessorPolicy> in, raft::mdspan<T, raft::matrix_extent<IndexType>, LayoutPolicy, AccessorPolicy> out) -> std::enable_if_t<std::is_floating_point_v<T>, void>#

Transpose a matrix. The output has same layout policy as the input.

Template Parameters:
  • T – Data type of input matrix element.

  • IndexType – Index type of matrix extent.

  • LayoutPolicy – Layout type of the input matrix. When layout is strided, it can be a submatrix of a larger matrix. Arbitrary stride is not supported.

  • AccessorPolicy – Accessor for the input and output, must be valid accessor on device.

Parameters:
  • handle[in] raft handle for managing expensive cuda resources.

  • in[in] Input matrix.

  • out[out] Output matrix, storage is pre-allocated by caller.