From 4d2c88df962040c63827d6427b5395b1e6a049c0 Mon Sep 17 00:00:00 2001 From: Mark Hoemmen Date: Wed, 17 Feb 2016 10:26:12 -0800 Subject: [PATCH 1/3] TpetraKernels: Add comments & static_assert to single-vec SpMV --- .../kernels/src/impl/Kokkos_Sparse_impl_spmv.hpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/tpetra/kernels/src/impl/Kokkos_Sparse_impl_spmv.hpp b/packages/tpetra/kernels/src/impl/Kokkos_Sparse_impl_spmv.hpp index 2e5dc39..eed79a2 100644 --- a/packages/tpetra/kernels/src/impl/Kokkos_Sparse_impl_spmv.hpp +++ b/packages/tpetra/kernels/src/impl/Kokkos_Sparse_impl_spmv.hpp @@ -161,6 +161,10 @@ struct SPMV_Transpose_Functor { } }; +// Functor for single-vector, non-transpose sparse matrix-vector multiply. +// +// If doalpha == 2, this accepts any alpha value. +// If dobeta == 2, this accepts any beta value. template (XVector::rank) == 1, + "XVector must be a rank 1 View."); + static_assert (static_cast (YVector::rank) == 1, + "YVector must be a rank 1 View."); + } KOKKOS_INLINE_FUNCTION void operator() (const team_member& dev) const @@ -273,6 +282,10 @@ struct SPMV_Functor { } }; +// Single-vector, non-transpose sparse matrix-vector multiply. +// +// If doalpha == 2, this accepts any alpha value. +// If dobeta == 2, this accepts any beta value. template OpType ; typename AMatrix::const_ordinal_type nrow = A.numRows(); @@ -342,6 +358,10 @@ static void spmv_alpha_beta_no_transpose(typename AMatrix::const_value_type& alp } } +// Single-vector, transpose sparse matrix-vector multiply. +// +// If doalpha == 2, this accepts any alpha value. +// If dobeta == 2, this accepts any beta value. template