Skip to content

Commit

Permalink
Finish updating sacado overloads of spmv
Browse files Browse the repository at this point in the history
  • Loading branch information
brian-kelley committed Mar 13, 2024
1 parent 26060b7 commit 3904ea8
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1470,6 +1470,9 @@ namespace KokkosSparse {
template <
#if KOKKOSKERNELS_VERSION >= 40199
typename ExecutionSpace,
#endif
#if KOKKOSKERNELS_VERSION >= 40299
typename Handle,
#endif
typename AlphaType,
typename BetaType,
Expand All @@ -1482,9 +1485,8 @@ typename std::enable_if<
Kokkos::is_view_uq_pce< Kokkos::View< InputType, InputP... > >::value &&
Kokkos::is_view_uq_pce< Kokkos::View< OutputType, OutputP... > >::value
#if KOKKOSKERNELS_VERSION >= 40299
// TODO what is an alternative compile-time option to determine the rank?
// Is rank appropriate here, or is additional checking based on specialize trait needed?
&& (Kokkos::View< OutputType, OutputP... >().rank() == 1)
&& KokkosSparse::is_crs_matrix_v<MatrixType>
&& (Kokkos::View< OutputType, OutputP... >::rank() == 1)
#endif
>::type
spmv(
Expand All @@ -1494,7 +1496,7 @@ spmv(
#if KOKKOSKERNELS_VERSION < 40299
KokkosKernels::Experimental::Controls,
#else
KokkosSparse::SPMVHandle<ExecutionSpace, MatrixType, Kokkos::View< InputType, InputP... >, Kokkos::View< OutputType, OutputP... >>* handle,
Handle* handle,
#endif
const char mode[],
const AlphaType& a,
Expand All @@ -1507,7 +1509,6 @@ spmv(
#endif
)
{
std::cout << " STOKHOS UQPCE SPMV R1" << std::endl;
typedef Kokkos::View< OutputType, OutputP... > OutputVectorType;
typedef Kokkos::View< InputType, InputP... > InputVectorType;
typedef Stokhos::Multiply<MatrixType, typename InputVectorType::const_type,
Expand Down Expand Up @@ -1544,6 +1545,9 @@ spmv(
template <
#if KOKKOSKERNELS_VERSION >= 40199
typename ExecutionSpace,
#endif
#if KOKKOSKERNELS_VERSION >= 40299
typename Handle,
#endif
typename AlphaType,
typename BetaType,
Expand All @@ -1556,9 +1560,8 @@ typename std::enable_if<
Kokkos::is_view_uq_pce< Kokkos::View< InputType, InputP... > >::value &&
Kokkos::is_view_uq_pce< Kokkos::View< OutputType, OutputP... > >::value
#if KOKKOSKERNELS_VERSION >= 40299
// TODO what is an alternative compile-time option to determine the rank?
// Is rank appropriate here, or is additional checking based on specialize trait needed?
&& (Kokkos::View< OutputType, OutputP... >().rank() == 2)
&& KokkosSparse::is_crs_matrix_v<MatrixType>
&& (Kokkos::View< OutputType, OutputP... >::rank() == 2)
#endif
>::type
spmv(
Expand All @@ -1568,7 +1571,7 @@ spmv(
#if KOKKOSKERNELS_VERSION < 40299
KokkosKernels::Experimental::Controls,
#else
KokkosSparse::SPMVHandle<ExecutionSpace, MatrixType, Kokkos::View< InputType, InputP... >, Kokkos::View< OutputType, OutputP... >>* handle,
Handle* handle,
#endif
const char mode[],
const AlphaType& a,
Expand All @@ -1581,7 +1584,6 @@ spmv(
#endif
)
{
std::cout << " STOKHOS UQPCE SPMV R2" << std::endl;
#if KOKKOSKERNELS_VERSION >= 40199
if(space != ExecutionSpace()) {
Kokkos::Impl::raise_error(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,9 @@ namespace KokkosSparse {
template <
#if KOKKOSKERNELS_VERSION >= 40199
typename ExecutionSpace,
#endif
#if KOKKOSKERNELS_VERSION >= 40299
typename Handle,
#endif
typename AlphaType,
typename BetaType,
Expand All @@ -544,9 +547,8 @@ typename std::enable_if<
Kokkos::is_view_mp_vector< Kokkos::View< InputType, InputP... > >::value &&
Kokkos::is_view_mp_vector< Kokkos::View< OutputType, OutputP... > >::value
#if KOKKOSKERNELS_VERSION >= 40299
// TODO what is an alternative compile-time option to determine the rank?
// Is rank appropriate here, or is additional checking based on specialize trait needed?
&& (Kokkos::View< OutputType, OutputP... >().rank() == 1)
&& KokkosSparse::is_crs_matrix_v<MatrixType>
&& (Kokkos::View< OutputType, OutputP... >::rank() == 1)
#endif
>::type
spmv(
Expand All @@ -556,7 +558,7 @@ spmv(
#if KOKKOSKERNELS_VERSION < 40299
KokkosKernels::Experimental::Controls,
#else
KokkosSparse::SPMVHandle<ExecutionSpace, MatrixType, Kokkos::View< InputType, InputP... >, Kokkos::View< OutputType, OutputP... >>* handle,
Handle* handle,
#endif
const char mode[],
const AlphaType& a,
Expand All @@ -567,9 +569,8 @@ spmv(
#if KOKKOSKERNELS_VERSION < 40299
, const RANK_ONE
#endif
)
)
{
std::cout << " STOKHOS MPVEC SPMV R1" << std::endl;
typedef Kokkos::View< OutputType, OutputP... > OutputVectorType;
typedef Kokkos::View< InputType, InputP... > InputVectorType;
using input_vector_type = const_type_t<InputVectorType>;
Expand Down Expand Up @@ -642,6 +643,9 @@ spmv(
template <
#if KOKKOSKERNELS_VERSION >= 40199
typename ExecutionSpace,
#endif
#if KOKKOSKERNELS_VERSION >= 40299
typename Handle,
#endif
typename AlphaType,
typename BetaType,
Expand All @@ -654,9 +658,8 @@ typename std::enable_if<
Kokkos::is_view_mp_vector< Kokkos::View< InputType, InputP... > >::value &&
Kokkos::is_view_mp_vector< Kokkos::View< OutputType, OutputP... > >::value
#if KOKKOSKERNELS_VERSION >= 40299
// TODO what is an alternative compile-time option to determine the rank?
// Is rank appropriate here, or is additional checking based on specialize trait needed?
&& (Kokkos::View< OutputType, OutputP... >().rank() == 2)
&& KokkosSparse::is_crs_matrix_v<MatrixType>
&& (Kokkos::View< OutputType, OutputP... >::rank() == 2)
#endif
>::type
spmv(
Expand All @@ -666,7 +669,7 @@ spmv(
#if KOKKOSKERNELS_VERSION < 40299
KokkosKernels::Experimental::Controls,
#else
KokkosSparse::SPMVHandle<ExecutionSpace, MatrixType, Kokkos::View< InputType, InputP... >, Kokkos::View< OutputType, OutputP... >>* handle,
Handle* handle,
#endif
const char mode[],
const AlphaType& a,
Expand All @@ -679,7 +682,6 @@ spmv(
#endif
)
{
std::cout << " STOKHOS MPVEC SPMV R2" << std::endl;
#if KOKKOSKERNELS_VERSION >= 40199
if(space != ExecutionSpace()) {
Kokkos::Impl::raise_error(
Expand Down

0 comments on commit 3904ea8

Please sign in to comment.