Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions blas/tpls/KokkosBlas2_gemv_tpl_spec_avail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,8 @@ KOKKOSBLAS2_GEMV_TPL_SPEC_AVAIL_CUBLAS(Kokkos::complex<float>, Kokkos::LayoutRig
#ifdef KOKKOSKERNELS_ENABLE_TPL_ROCBLAS

#define KOKKOSBLAS2_GEMV_TPL_SPEC_AVAIL_ROCBLAS(SCALAR, LAYOUT) \
template <class ExecSpace> \
struct gemv_tpl_spec_avail<ExecSpace, \
template <> \
struct gemv_tpl_spec_avail<Kokkos::HIP, \
Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<Kokkos::HIP, Kokkos::HIPSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const SCALAR*, LAYOUT, Kokkos::Device<Kokkos::HIP, Kokkos::HIPSpace>, \
Expand Down
24 changes: 12 additions & 12 deletions blas/tpls/KokkosBlas2_gemv_tpl_spec_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -409,9 +409,9 @@ namespace Impl {
}

#define KOKKOSBLAS2_DGEMV_ROCBLAS(LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \
template <class ExecSpace> \
template <> \
struct GEMV< \
ExecSpace, \
Kokkos::HIP, \
Kokkos::View<const double**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const double*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Expand All @@ -429,7 +429,7 @@ namespace Impl {
Kokkos::MemoryTraits<Kokkos::Unmanaged> > \
YViewType; \
\
static void gemv(const ExecSpace& space, const char trans[], typename AViewType::const_value_type& alpha, \
static void gemv(const Kokkos::HIP& space, const char trans[], typename AViewType::const_value_type& alpha, \
const AViewType& A, const XViewType& X, typename YViewType::const_value_type& beta, \
const YViewType& Y) { \
Kokkos::Profiling::pushRegion("KokkosBlas::gemv[TPL_ROCBLAS,double]"); \
Expand All @@ -444,9 +444,9 @@ namespace Impl {
};

#define KOKKOSBLAS2_SGEMV_ROCBLAS(LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \
template <class ExecSpace> \
template <> \
struct GEMV< \
ExecSpace, \
Kokkos::HIP, \
Kokkos::View<const float**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const float*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Expand All @@ -464,7 +464,7 @@ namespace Impl {
Kokkos::MemoryTraits<Kokkos::Unmanaged> > \
YViewType; \
\
static void gemv(const ExecSpace& space, const char trans[], typename AViewType::const_value_type& alpha, \
static void gemv(const Kokkos::HIP& space, const char trans[], typename AViewType::const_value_type& alpha, \
const AViewType& A, const XViewType& X, typename YViewType::const_value_type& beta, \
const YViewType& Y) { \
Kokkos::Profiling::pushRegion("KokkosBlas::gemv[TPL_ROCBLAS,float]"); \
Expand All @@ -479,8 +479,8 @@ namespace Impl {
};

#define KOKKOSBLAS2_ZGEMV_ROCBLAS(LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \
template <class ExecSpace> \
struct GEMV<ExecSpace, \
template <> \
struct GEMV<Kokkos::HIP, \
Kokkos::View<const Kokkos::complex<double>**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const Kokkos::complex<double>*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Expand All @@ -499,7 +499,7 @@ namespace Impl {
Kokkos::MemoryTraits<Kokkos::Unmanaged> > \
YViewType; \
\
static void gemv(const ExecSpace& space, const char trans[], typename AViewType::const_value_type& alpha, \
static void gemv(const Kokkos::HIP& space, const char trans[], typename AViewType::const_value_type& alpha, \
const AViewType& A, const XViewType& X, typename YViewType::const_value_type& beta, \
const YViewType& Y) { \
Kokkos::Profiling::pushRegion("KokkosBlas::gemv[TPL_ROCBLAS,complex<double>]"); \
Expand All @@ -518,8 +518,8 @@ namespace Impl {
};

#define KOKKOSBLAS2_CGEMV_ROCBLAS(LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \
template <class ExecSpace> \
struct GEMV<ExecSpace, \
template <> \
struct GEMV<Kokkos::HIP, \
Kokkos::View<const Kokkos::complex<float>**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const Kokkos::complex<float>*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Expand All @@ -538,7 +538,7 @@ namespace Impl {
Kokkos::MemoryTraits<Kokkos::Unmanaged> > \
YViewType; \
\
static void gemv(const ExecSpace& space, const char trans[], typename AViewType::const_value_type& alpha, \
static void gemv(const Kokkos::HIP& space, const char trans[], typename AViewType::const_value_type& alpha, \
const AViewType& A, const XViewType& X, typename YViewType::const_value_type& beta, \
const YViewType& Y) { \
Kokkos::Profiling::pushRegion("KokkosBlas::gemv[TPL_ROCBLAS,complex<float>]"); \
Expand Down
20 changes: 10 additions & 10 deletions blas/tpls/KokkosBlas3_gemm_tpl_spec_avail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ KOKKOSBLAS3_GEMM_TPL_SPEC_AVAIL_CUBLAS(Kokkos::complex<float>, Kokkos::LayoutRig
// rocBLAS
#if defined(KOKKOSKERNELS_ENABLE_TPL_ROCBLAS)

#define KOKKOSBLAS3_GEMM_TPL_SPEC_AVAIL_ROCBLAS(SCALAR, LAYOUT, MEMSPACE) \
template <class ExecSpace> \
struct gemm_tpl_spec_avail<ExecSpace, \
Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<SCALAR**, LAYOUT, Kokkos::Device<ExecSpace, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> > > { \
enum : bool { value = true }; \
#define KOKKOSBLAS3_GEMM_TPL_SPEC_AVAIL_ROCBLAS(SCALAR, LAYOUT, MEMSPACE) \
template <> \
struct gemm_tpl_spec_avail<Kokkos::HIP, \
Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<SCALAR**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> > > { \
enum : bool { value = true }; \
};

KOKKOSBLAS3_GEMM_TPL_SPEC_AVAIL_ROCBLAS(double, Kokkos::LayoutLeft, Kokkos::HIPSpace)
Expand Down
18 changes: 9 additions & 9 deletions blas/tpls/KokkosBlas3_gemm_tpl_spec_decl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -248,23 +248,23 @@ namespace KokkosBlas {
namespace Impl {

#define KOKKOSBLAS3_XGEMM_ROCBLAS(SCALAR_TYPE, ROCBLAS_SCALAR_TYPE, ROCBLAS_FN, LAYOUT, MEM_SPACE, ETI_SPEC_AVAIL) \
template <class ExecSpace> \
struct GEMM<ExecSpace, \
Kokkos::View<const SCALAR_TYPE**, LAYOUT, Kokkos::Device<ExecSpace, MEM_SPACE>, \
template <> \
struct GEMM<Kokkos::HIP, \
Kokkos::View<const SCALAR_TYPE**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<const SCALAR_TYPE**, LAYOUT, Kokkos::Device<ExecSpace, MEM_SPACE>, \
Kokkos::View<const SCALAR_TYPE**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
Kokkos::View<SCALAR_TYPE**, LAYOUT, Kokkos::Device<ExecSpace, MEM_SPACE>, \
Kokkos::View<SCALAR_TYPE**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> >, \
true, ETI_SPEC_AVAIL> { \
typedef SCALAR_TYPE SCALAR; \
typedef Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<ExecSpace, MEM_SPACE>, \
typedef Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> > \
AViewType; \
typedef Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<ExecSpace, MEM_SPACE>, \
typedef Kokkos::View<const SCALAR**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> > \
BViewType; \
typedef Kokkos::View<SCALAR**, LAYOUT, Kokkos::Device<ExecSpace, MEM_SPACE>, \
typedef Kokkos::View<SCALAR**, LAYOUT, Kokkos::Device<Kokkos::HIP, MEM_SPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged> > \
CViewType; \
\
Expand Down Expand Up @@ -293,7 +293,7 @@ namespace Impl {
M * N < numDotsLayoutLeftThreshold) || \
(is_lr && transa != rocblas_operation_none && transb == rocblas_operation_none && \
M * N < numDotsLayoutRightThreshold)) { \
DotBasedGEMM<ExecSpace, AViewType, BViewType, CViewType> gemm(alpha, A, B, beta, C); \
DotBasedGEMM<Kokkos::HIP, AViewType, BViewType, CViewType> gemm(alpha, A, B, beta, C); \
bool conjT = (std::is_same<SCALAR, double>::value || std::is_same<SCALAR, float>::value) \
? false \
: (transa == rocblas_operation_conjugate_transpose ? true : false); \
Expand Down
23 changes: 23 additions & 0 deletions blas/tpls/KokkosBlas_tpl_spec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,16 @@ inline cublasOperation_t trans_mode_kk_to_cublas(const char kkMode[]) {
return trans;
}

/// \brief This function converts KK side mode to cuBLAS side mode
inline cublasSideMode_t side_mode_kk_to_cublas(const char kkMode[]) {
cublasSideMode_t side;
if ((kkMode[0] == 'L') || (kkMode[0] == 'l'))
side = CUBLAS_SIDE_LEFT;
else
side = CUBLAS_SIDE_RIGHT;
return side;
}

} // namespace Impl
} // namespace KokkosBlas
#endif // KOKKOSKERNELS_ENABLE_TPL_CUBLAS
Expand Down Expand Up @@ -187,6 +197,19 @@ inline rocblas_operation trans_mode_kk_to_rocblas(const char kkMode[]) {
return trans;
}

/// \brief This function converts KK side mode to rocBLAS side mode
inline rocblas_side side_mode_kk_to_rocblas(const char kkSide[]) {
rocblas_side side;
if (kkSide[0] == 'L' || kkSide[0] == 'l') {
side = rocblas_side_left;
} else if (kkSide[0] == 'R' || kkSide[0] == 'r') {
side = rocblas_side_right;
} else {
side = rocblas_side_both;
}
return side;
}

} // namespace Impl
} // namespace KokkosBlas

Expand Down
23 changes: 12 additions & 11 deletions docs/source/API/lapack-index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ API: LAPACK
:hidden:

lapack/geqrf
lapack/mqr
lapack/potrf
lapack/gesv
lapack/gesvd
Expand Down Expand Up @@ -72,11 +73,11 @@ Below are tables summarizing the currently supported function calls and third pa
-
* - geqrf
- :doc:`geqrf <lapack/geqrf>`
-
-
-
-
-
- --
- X
- X
- X
- --
* - potrf
- :doc:`potrf <lapack/potrf>`
- --
Expand All @@ -92,12 +93,12 @@ Below are tables summarizing the currently supported function calls and third pa
-
-
* - unmqr
-
-
-
-
-
-
- :doc:`mqr <lapack/mqr>`
- --
- X
- X
- X
- --
* - gesvd
- :doc:`gesvd <lapack/gesvd>`
- --
Expand Down
4 changes: 2 additions & 2 deletions docs/source/API/lapack/geqrf.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
KokkosLapack::geqrf
###################
KokkosLapack::Experimental::geqrf
#################################
Comment thread
lucbv marked this conversation as resolved.
Outdated

Defined in header: :code:`KokkosLapack_geqrf.hpp`

Expand Down
Loading
Loading