Skip to content

Commit

Permalink
Fixing spmv build errors with TPLs
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-kelley committed Aug 22, 2023
1 parent 6637f94 commit 88cd6ac
Show file tree
Hide file tree
Showing 3 changed files with 82 additions and 76 deletions.
12 changes: 6 additions & 6 deletions sparse/impl/KokkosSparse_spmv_bsrmatrix_spec.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ struct spmv_mv_bsrmatrix_eti_spec_avail {
template <> \
struct spmv_bsrmatrix_eti_spec_avail< \
EXEC_SPACE_TYPE, \
KokkosSparse::Experimental::BsrMatrix< \
::KokkosSparse::Experimental::BsrMatrix< \
const SCALAR_TYPE, const ORDINAL_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET_TYPE>, \
Expand All @@ -75,7 +75,7 @@ struct spmv_mv_bsrmatrix_eti_spec_avail {
template <> \
struct spmv_mv_bsrmatrix_eti_spec_avail< \
EXEC_SPACE_TYPE, \
KokkosSparse::Experimental::BsrMatrix< \
::KokkosSparse::Experimental::BsrMatrix< \
const SCALAR_TYPE, const ORDINAL_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET_TYPE>, \
Expand Down Expand Up @@ -389,7 +389,7 @@ struct SPMV_MV_BSRMATRIX<ExecutionSpace, AMatrix, XVector, YVector, true, false,
MEM_SPACE_TYPE) \
extern template struct SPMV_BSRMATRIX< \
EXEC_SPACE_TYPE, \
KokkosSparse::Experimental::BsrMatrix< \
::KokkosSparse::Experimental::BsrMatrix< \
const SCALAR_TYPE, const ORDINAL_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET_TYPE>, \
Expand All @@ -407,7 +407,7 @@ struct SPMV_MV_BSRMATRIX<ExecutionSpace, AMatrix, XVector, YVector, true, false,
MEM_SPACE_TYPE) \
template struct SPMV_BSRMATRIX< \
EXEC_SPACE_TYPE, \
KokkosSparse::Experimental::BsrMatrix< \
::KokkosSparse::Experimental::BsrMatrix< \
const SCALAR_TYPE, const ORDINAL_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET_TYPE>, \
Expand All @@ -428,7 +428,7 @@ struct SPMV_MV_BSRMATRIX<ExecutionSpace, AMatrix, XVector, YVector, true, false,
MEM_SPACE_TYPE) \
extern template struct SPMV_MV_BSRMATRIX< \
EXEC_SPACE_TYPE, \
KokkosSparse::Experimental::BsrMatrix< \
::KokkosSparse::Experimental::BsrMatrix< \
const SCALAR_TYPE, const ORDINAL_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET_TYPE>, \
Expand All @@ -446,7 +446,7 @@ struct SPMV_MV_BSRMATRIX<ExecutionSpace, AMatrix, XVector, YVector, true, false,
MEM_SPACE_TYPE) \
template struct SPMV_MV_BSRMATRIX< \
EXEC_SPACE_TYPE, \
KokkosSparse::Experimental::BsrMatrix< \
::KokkosSparse::Experimental::BsrMatrix< \
const SCALAR_TYPE, const ORDINAL_TYPE, \
Kokkos::Device<EXEC_SPACE_TYPE, MEM_SPACE_TYPE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET_TYPE>, \
Expand Down
126 changes: 66 additions & 60 deletions sparse/tpls/KokkosSparse_spmv_bsrmatrix_tpl_spec_avail.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,20 @@ struct spmv_bsrmatrix_tpl_spec_avail {
// These versions of cuSPARSE require the ordinal and offset types to be the
// same. For KokkosKernels, this means int/int only.

#define KOKKOSSPARSE_SPMV_BSRMATRIX_TPL_SPEC_AVAIL_CUSPARSE( \
SCALAR, ORDINAL, OFFSET, XL, YL, MEMSPACE) \
template <> \
struct spmv_bsrmatrix_tpl_spec_avail< \
Kokkos::Cuda, \
KokkosSparse::Experimental::BsrMatrix< \
const SCALAR, const ORDINAL, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET>, \
Kokkos::View< \
const SCALAR*, XL, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR*, YL, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>> { \
enum : bool { value = true }; \
#define KOKKOSSPARSE_SPMV_BSRMATRIX_TPL_SPEC_AVAIL_CUSPARSE( \
SCALAR, ORDINAL, OFFSET, XL, YL, MEMSPACE) \
template <> \
struct spmv_bsrmatrix_tpl_spec_avail< \
Kokkos::Cuda, \
::KokkosSparse::Experimental::BsrMatrix<const SCALAR, const ORDINAL, \
Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET>, \
Kokkos::View< \
const SCALAR*, XL, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR*, YL, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>> { \
enum : bool { value = true }; \
};

#if (9000 <= CUDA_VERSION)
Expand Down Expand Up @@ -129,18 +129,18 @@ KOKKOSSPARSE_SPMV_BSRMATRIX_TPL_SPEC_AVAIL_CUSPARSE(Kokkos::complex<double>,
#ifdef KOKKOSKERNELS_ENABLE_TPL_MKL
#define KOKKOSSPARSE_SPMV_BSRMATRIX_TPL_SPEC_AVAIL_MKL(SCALAR, EXECSPACE) \
template <> \
struct spmv_bsrmatrix_tpl_spec_avail < EXECSPACE, \
KokkosSparse::Experimental::BsrMatrix< \
const SCALAR, const MKL_INT, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const MKL_INT>, \
struct spmv_bsrmatrix_tpl_spec_avail< \
EXECSPACE, \
::KokkosSparse::Experimental::BsrMatrix<const SCALAR, const MKL_INT, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const MKL_INT>, \
Kokkos::View< \
const SCALAR*, Kokkos::LayoutLeft, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR*, Kokkos::LayoutLeft, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>> { \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>> { \
enum : bool { value = true }; \
};

Expand Down Expand Up @@ -178,21 +178,21 @@ struct spmv_mv_bsrmatrix_tpl_spec_avail {
// These versions of cuSPARSE require the ordinal and offset types to be the
// same. For KokkosKernels, this means int/int only.
// cuSparse level 3 does not currently support LayoutRight
#define KOKKOSSPARSE_SPMV_MV_BSRMATRIX_TPL_SPEC_AVAIL_CUSPARSE( \
SCALAR, ORDINAL, OFFSET, LAYOUT, MEMSPACE) \
template <> \
struct spmv_mv_bsrmatrix_tpl_spec_avail< \
Kokkos::Cuda, \
KokkosSparse::Experimental::BsrMatrix< \
const SCALAR, const ORDINAL, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET>, \
Kokkos::View< \
const SCALAR**, LAYOUT, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR**, LAYOUT, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
false> { \
enum : bool { value = true }; \
#define KOKKOSSPARSE_SPMV_MV_BSRMATRIX_TPL_SPEC_AVAIL_CUSPARSE( \
SCALAR, ORDINAL, OFFSET, LAYOUT, MEMSPACE) \
template <> \
struct spmv_mv_bsrmatrix_tpl_spec_avail< \
Kokkos::Cuda, \
::KokkosSparse::Experimental::BsrMatrix<const SCALAR, const ORDINAL, \
Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET>, \
Kokkos::View< \
const SCALAR**, LAYOUT, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR**, LAYOUT, Kokkos::Device<Kokkos::Cuda, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
false> { \
enum : bool { value = true }; \
};

#if (9000 <= CUDA_VERSION)
Expand Down Expand Up @@ -230,17 +230,23 @@ KOKKOSSPARSE_SPMV_MV_BSRMATRIX_TPL_SPEC_AVAIL_CUSPARSE(Kokkos::complex<double>,
#endif // KOKKOSKERNELS_ENABLE_TPL_CUSPARSE

#ifdef KOKKOSKERNELS_ENABLE_TPL_MKL
#define KOKKOSSPARSE_SPMV_MV_BSRMATRIX_TPL_SPEC_AVAIL_MKL(SCALAR, EXECSPACE) \
template <> \
struct spmv_mv_bsrmatrix_tpl_spec_avail< \
EXECSPACE, const SCALAR, const int, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const int, const SCALAR*, \
Kokkos::LayoutLeft, Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>, SCALAR*, \
Kokkos::LayoutLeft, Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, true> { \
enum : bool { value = true }; \
#define KOKKOSSPARSE_SPMV_MV_BSRMATRIX_TPL_SPEC_AVAIL_MKL(SCALAR, EXECSPACE) \
template <> \
struct spmv_mv_bsrmatrix_tpl_spec_avail< \
EXECSPACE, \
::KokkosSparse::Experimental::BsrMatrix< \
const SCALAR, const int, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const int>, \
Kokkos::View< \
const SCALAR*, Kokkos::LayoutLeft, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR*, Kokkos::LayoutLeft, \
Kokkos::Device<EXECSPACE, Kokkos::HostSpace>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>, \
true> { \
enum : bool { value = true }; \
};

#ifdef KOKKOS_ENABLE_SERIAL
Expand All @@ -267,20 +273,20 @@ KOKKOSSPARSE_SPMV_MV_BSRMATRIX_TPL_SPEC_AVAIL_MKL(Kokkos::complex<double>,

#include "KokkosSparse_Utils_rocsparse.hpp"

#define KOKKOSSPARSE_SPMV_BSRMATRIX_TPL_SPEC_AVAIL_ROCSPARSE( \
SCALAR, ORDINAL, OFFSET, LAYOUT, MEMSPACE) \
template <> \
struct spmv_bsrmatrix_tpl_spec_avail< \
Kokkos::HIP, \
KokkosSparse::Experimental::BsrMatrix< \
const SCALAR, const ORDINAL, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET>, \
Kokkos::View< \
const SCALAR*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>> { \
enum : bool { value = true }; \
#define KOKKOSSPARSE_SPMV_BSRMATRIX_TPL_SPEC_AVAIL_ROCSPARSE( \
SCALAR, ORDINAL, OFFSET, LAYOUT, MEMSPACE) \
template <> \
struct spmv_bsrmatrix_tpl_spec_avail< \
Kokkos::HIP, \
::KokkosSparse::Experimental::BsrMatrix<const SCALAR, const ORDINAL, \
Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>, const OFFSET>, \
Kokkos::View< \
const SCALAR*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged | Kokkos::RandomAccess>>, \
Kokkos::View<SCALAR*, LAYOUT, Kokkos::Device<Kokkos::HIP, MEMSPACE>, \
Kokkos::MemoryTraits<Kokkos::Unmanaged>>> { \
enum : bool { value = true }; \
};

#if KOKKOSSPARSE_IMPL_ROCM_VERSION >= 50200
Expand Down
Loading

0 comments on commit 88cd6ac

Please sign in to comment.