BLAS3 – KokkosKernels blas3 interfaces

gemm

template<class execution_space, class AViewType, class BViewType, class CViewType>
void KokkosBlas::gemm(const execution_space &space, const char transA[], const char transB[], typename AViewType::const_value_type &alpha, const AViewType &A, const BViewType &B, typename CViewType::const_value_type &beta, const CViewType &C)

Dense matrix-matrix multiply: C = beta*C + alpha*op(A)*op(B).

Template Parameters:
  • AViewType – Input matrix, as a 2-D Kokkos::View

  • BViewType – Input matrix, as a 2-D Kokkos::View

  • CViewType – Output matrix, as a nonconst 2-D Kokkos::View

Parameters:
  • space – [in] an execution space instance

  • transA – [in] “N” for non-transpose, “T” for transpose, “C” for conjugate transpose. All characters after the first are ignored. This works just like the BLAS routines.

  • transB – [in] “N” for non-transpose, “T” for transpose, “C” for conjugate transpose. All characters after the first are ignored. This works just like the BLAS routines.

  • alpha – [in] Input coefficient of A*x

  • A – [in] Input matrix, as a 2-D Kokkos::View

  • B – [in] Input matrix, as a 2-D Kokkos::View

  • beta – [in] Input coefficient of C

  • C – [in/out] Output vector, as a nonconst 2-D Kokkos::View

template<class AViewType, class BViewType, class CViewType>
void KokkosBlas::gemm(const char transA[], const char transB[], typename AViewType::const_value_type &alpha, const AViewType &A, const BViewType &B, typename CViewType::const_value_type &beta, const CViewType &C)

Dense matrix-matrix multiply: C = beta*C + alpha*op(A)*op(B).

Template Parameters:
  • AViewType – Input matrix, as a 2-D Kokkos::View

  • BViewType – Input matrix, as a 2-D Kokkos::View

  • CViewType – Output matrix, as a nonconst 2-D Kokkos::View

Parameters:
  • transA – [in] “N” for non-transpose, “T” for transpose, “C” for conjugate transpose. All characters after the first are ignored. This works just like the BLAS routines.

  • transB – [in] “N” for non-transpose, “T” for transpose, “C” for conjugate transpose. All characters after the first are ignored. This works just like the BLAS routines.

  • alpha – [in] Input coefficient of A*x

  • A – [in] Input matrix, as a 2-D Kokkos::View

  • B – [in] Input matrix, as a 2-D Kokkos::View

  • beta – [in] Input coefficient of C

  • C – [in/out] Output vector, as a nonconst 2-D Kokkos::View

trmm

template<class execution_space, class AViewType, class BViewType>
void KokkosBlas::trmm(const execution_space &space, const char side[], const char uplo[], const char trans[], const char diag[], typename BViewType::const_value_type &alpha, const AViewType &A, const BViewType &B)

Triangular matrix multiply:

   B = alpha * op(A) * B if side == "L" or "l"
   B = alpha * B * op(A) if side == "R" or "r"
This function is currently blocking when running the native implementation which only has a serial implementation.

Template Parameters:
  • execution_space – a Kokkos execution space to run the kernels on.

  • AViewType – Input matrix, as a 2-D Kokkos::View

  • BViewType – Input(RHS)/Output(solution) M-by-N matrix, as a 2-D Kokkos::View

Parameters:
  • space – [in] an execution space instance that may contain a stream or a queue to execute the kernel on, this only works with TPLs at the moment.

  • side – [in] “L” or “l” indicates matrix A is on the left of B “R” or “r” indicates matrix A is on the right of B

  • uplo – [in] “U” or “u” indicates matrix A is an upper triangular matrix “L” or “l” indicates matrix A is a lower triangular matrix

  • trans – [in] Specifies what op does to A:

  • diag – [in] “U” or “u” indicates the diagonal of A is assumed to be unit

  • alpha – [in] Input coefficient used for

  • A – [in] Input matrix, as a 2-D Kokkos::View If side == “L” or “l”, matrix A is a M-by-M triangular matrix; otherwise, matrix A is a N-by-N triangular matrix

  • B – [in,out] Input/Output matrix, as a 2-D Kokkos::View On entry, M-by-N matrix On exit, overwritten with the solution

template<class AViewType, class BViewType>
void KokkosBlas::trmm(const char side[], const char uplo[], const char trans[], const char diag[], typename BViewType::const_value_type &alpha, const AViewType &A, const BViewType &B)

Solve triangular linear system with multiple RHSs: B = alpha * op(A) * B if side == “L” or “l” B = alpha * B * op(A) if side == “R” or “r”.

Template Parameters:
  • AViewType – Input matrix, as a 2-D Kokkos::View

  • BViewType – Input(RHS)/Output(solution) M-by-N matrix, as a 2-D Kokkos::View

Parameters:
  • side – [in] “L” or “l” indicates matrix A is on the left of B “R” or “r” indicates matrix A is on the right of B

  • uplo – [in] “U” or “u” indicates matrix A is an upper triangular matrix “L” or “l” indicates matrix A is a lower triangular matrix

  • trans – [in] Specifies what op does to A:

  • diag – [in] “U” or “u” indicates the diagonal of A is assumed to be unit

  • alpha – [in] Input coefficient used for

  • A – [in] Input matrix, as a 2-D Kokkos::View If side == “L” or “l”, matrix A is a M-by-M triangular matrix; otherwise, matrix A is a N-by-N triangular matrix

  • B – [in,out] Input/Output matrix, as a 2-D Kokkos::View On entry, M-by-N matrix On exit, overwritten with the solution

trtri

template<class AViewType>
int KokkosBlas::trtri(const char uplo[], const char diag[], const AViewType &A)

Find the inverse of the triangular matrix, A.

   A = inv(A)

Template Parameters:

AViewType – Input matrix, as a 2-D Kokkos::View

Parameters:
  • uplo – [in] “U” or “u” indicates matrix A is an upper triangular matrix “L” or “l” indicates matrix A is a lower triangular matrix

  • diag – [in] “U” or “u” indicates the diagonal of A is assumed to be unit

  • A – [in,out] Input matrix, as a 2-D Kokkos::View On entry, A On successful exit, inv(A)

Returns:

0 upon success,

trsm

template<class execution_space, class AViewType, class BViewType>
void KokkosBlas::trsm(const execution_space &space, const char side[], const char uplo[], const char trans[], const char diag[], typename BViewType::const_value_type &alpha, const AViewType &A, const BViewType &B)

Solve triangular linear system with multiple RHSs: op(A)*X = alpha*B if side == “L” or “l” X*op(A) = alpha*B if side == “R” or “r” This function is currently blocking when running the native implementation which only has a serial implementation.

Template Parameters:
  • execution_space – a Kokkos execution space to run the kernels on.

  • AViewType – Input matrix, as a 2-D Kokkos::View

  • BViewType – Input(RHS)/Output(solution) M-by-N matrix, as a 2-D Kokkos::View

Parameters:
  • space – [in] an execution space instance that may contain a stream or a queue to execute the kernel on, this only works with TPLs at the moment.

  • side – [in] “L” or “l” indicates matrix A is on the left of X “R” or “r” indicates matrix A is on the right of X

  • uplo – [in] “U” or “u” indicates matrix A upper part is stored, the other part is not referenced “L” or “l” indicates matrix A lower part is stored, the other part is not referenced

  • trans – [in] “N” or “n” for non-transpose, “T” or “t” for transpose, “C” or “c” for conjugate transpose.

  • diag – [in] “U” or “u” indicates the diagonal of A is assumed to be unit

  • alpha – [in] Input coefficient used for multiplication with B

  • A – [in] Input matrix, as a 2-D Kokkos::View If side == “L” or “l”, matrix A is a M-by-M triangular matrix; otherwise, matrix A is a N-by-N triangular matrix

  • B – [in,out] Input/Output matrix, as a 2-D Kokkos::View On entry, M-by-N matrix of multile RHS On exit, overwritten with the solution X

template<class AViewType, class BViewType>
void KokkosBlas::trsm(const char side[], const char uplo[], const char trans[], const char diag[], typename BViewType::const_value_type &alpha, const AViewType &A, const BViewType &B)

Solve triangular linear system with multiple RHSs: op(A)*X = alpha*B if side == “L” or “l” X*op(A) = alpha*B if side == “R” or “r”.

Template Parameters:
  • AViewType – Input matrix, as a 2-D Kokkos::View

  • BViewType – Input(RHS)/Output(solution) M-by-N matrix, as a 2-D Kokkos::View

Parameters:
  • side – [in] “L” or “l” indicates matrix A is on the left of X “R” or “r” indicates matrix A is on the right of X

  • uplo – [in] “U” or “u” indicates matrix A upper part is stored, the other part is not referenced “L” or “l” indicates matrix A lower part is stored, the other part is not referenced

  • trans – [in] “N” or “n” for non-transpose, “T” or “t” for transpose, “C” or “c” for conjugate transpose.

  • diag – [in] “U” or “u” indicates the diagonal of A is assumed to be unit

  • alpha – [in] Input coefficient used for multiplication with B

  • A – [in] Input matrix, as a 2-D Kokkos::View If side == “L” or “l”, matrix A is a M-by-M triangular matrix; otherwise, matrix A is a N-by-N triangular matrix

  • B – [in,out] Input/Output matrix, as a 2-D Kokkos::View On entry, M-by-N matrix of multile RHS On exit, overwritten with the solution X