Stokhos Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Kokkos_CrsMatrix_MP_Vector.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Stokhos Package
5// Copyright (2009) Sandia Corporation
6//
7// Under terms of Contract DE-AC04-94AL85000, there is a non-exclusive
8// license for use of this work by or on behalf of the U.S. Government.
9//
10// Redistribution and use in source and binary forms, with or without
11// modification, are permitted provided that the following conditions are
12// met:
13//
14// 1. Redistributions of source code must retain the above copyright
15// notice, this list of conditions and the following disclaimer.
16//
17// 2. Redistributions in binary form must reproduce the above copyright
18// notice, this list of conditions and the following disclaimer in the
19// documentation and/or other materials provided with the distribution.
20//
21// 3. Neither the name of the Corporation nor the names of the
22// contributors may be used to endorse or promote products derived from
23// this software without specific prior written permission.
24//
25// THIS SOFTWARE IS PROVIDED BY SANDIA CORPORATION "AS IS" AND ANY
26// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
27// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL SANDIA CORPORATION OR THE
29// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
30// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
31// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
32// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
33// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
34// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36//
37// Questions? Contact Eric T. Phipps (etphipp@sandia.gov).
38//
39// ***********************************************************************
40// @HEADER
41
42#ifndef KOKKOS_CRSMATRIX_MP_VECTOR_HPP
43#define KOKKOS_CRSMATRIX_MP_VECTOR_HPP
44
45#include <type_traits>
46
47#include "Sacado_MP_Vector.hpp"
49#include "KokkosSparse_CrsMatrix.hpp"
51#include "KokkosSparse_spmv.hpp"
52#include "Kokkos_Blas1_MP_Vector.hpp" // for some utilities
53
54#include "Kokkos_Core.hpp"
55#include "Stokhos_Multiply.hpp"
56
57#include "Teuchos_TestForException.hpp"
58
59//----------------------------------------------------------------------------
60// Specializations of KokkosSparse::CrsMatrix for Sacado::MP::Vector scalar type
61//----------------------------------------------------------------------------
62
63namespace { // (anonymous)
64
65template<class T, class = std::void_t<> >
66struct const_type_impl {
67 using type = T;
68};
69
70template<class T>
71struct const_type_impl<T,
72 std::void_t<typename T::const_type> > {
73 using type = typename T::const_type;
74};
75
76template<class T>
77using const_type_t = typename const_type_impl<T>::type;
78
79} // namespace (anonymous)
80
81namespace Stokhos {
82
83namespace details {
84
85template <typename Matrix, typename InputVector, typename OutputVector,
86 typename Update = MultiplyAssign,
87 typename Enabled = void>
88class MPMultiply {};
89
90// Kernel implementing y = A * x where
91// A == KokkosSparse::CrsMatrix< const Sacado::MP::Vector<...>,...>,
92// x, y == Kokkos::View< Sacado::MP::Vector<...>*,...>,
93// x and y are rank 1, any layout
94// We spell everything out here to make sure the ranks and devices match.
95//
96// This implementation uses overloaded operators for MP::Vector.
97template <typename MatrixDevice,
98 typename MatrixStorage,
99 typename MatrixOrdinal,
100 typename MatrixMemory,
101 typename MatrixSize,
102 typename InputStorage,
103 typename ... InputP,
104 typename OutputStorage,
105 typename ... OutputP,
106 typename Update>
107class MPMultiply< KokkosSparse::CrsMatrix< const Sacado::MP::Vector<MatrixStorage>,
108 MatrixOrdinal,
109 MatrixDevice,
110 MatrixMemory,
111 MatrixSize>,
112 Kokkos::View< const Sacado::MP::Vector<InputStorage>*,
113 InputP... >,
114 Kokkos::View< Sacado::MP::Vector<OutputStorage>*,
115 OutputP... >,
116 Update
117#ifdef KOKKOS_ENABLE_CUDA
118 , typename std::enable_if<
119 !std::is_same<typename MatrixDevice::execution_space,Kokkos::Cuda>::value >::type
120#endif
121 >
122{
123
124public:
125
130
131 typedef typename MatrixDevice::execution_space execution_space;
132 typedef typename execution_space::size_type size_type;
133
134 typedef KokkosSparse::CrsMatrix< const MatrixValue,
135 MatrixOrdinal,
136 MatrixDevice,
137 MatrixMemory,
138 MatrixSize > matrix_type;
139 typedef Kokkos::View< const InputVectorValue*,
140 InputP... > input_vector_type;
141 typedef Kokkos::View< OutputVectorValue*,
142 OutputP... > output_vector_type;
144
149
151 const input_vector_type & x,
152 const output_vector_type & y,
153 const update_type& update )
154 : m_A( A )
155 , m_x( x )
156 , m_y( y )
157 , m_update( update )
158 {}
159
160 KOKKOS_INLINE_FUNCTION
161 void operator()( const size_type iRow ) const
162 {
163 // Compute mat-vec for this row
164 const size_type iEntryBegin = m_A.graph.row_map[iRow];
165 const size_type iEntryEnd = m_A.graph.row_map[iRow+1];
166 scalar_type sum = 0.0;
167 for (size_type iEntry = iEntryBegin; iEntry < iEntryEnd; ++iEntry) {
168 size_type iCol = m_A.graph.entries(iEntry);
169 sum += m_A.values(iEntry) * m_x(iCol);
170 }
171 m_update( m_y(iRow), sum );
172 } // operator()
173
174 static void apply( const matrix_type & A,
175 const input_vector_type & x,
176 const output_vector_type & y,
177 const update_type & update )
178 {
179 const size_type row_count = A.graph.row_map.extent(0)-1;
180 Kokkos::parallel_for( row_count, MPMultiply(A,x,y,update) );
181 }
182};
183
184// Kernel implementing y = A * x where
185// A == KokkosSparse::CrsMatrix< Sacado::MP::Vector<...>,...>,
186// x, y == Kokkos::View< Sacado::MP::Vector<...>**,...>,
187// x and y are rank 2, any layout
188// We spell everything out here to make sure the ranks and devices match.
189//
190// This implementation uses overloaded operators for MP::Vector.
191template <typename MatrixDevice,
192 typename MatrixStorage,
193 typename MatrixOrdinal,
194 typename MatrixMemory,
195 typename MatrixSize,
196 typename InputStorage,
197 typename ... InputP,
198 typename OutputStorage,
199 typename ... OutputP,
200 typename Update>
201class MPMultiply< KokkosSparse::CrsMatrix< const Sacado::MP::Vector<MatrixStorage>,
202 MatrixOrdinal,
203 MatrixDevice,
204 MatrixMemory,
205 MatrixSize >,
206 Kokkos::View< const Sacado::MP::Vector<InputStorage>**,
207 InputP... >,
208 Kokkos::View< Sacado::MP::Vector<OutputStorage>**,
209 OutputP... >,
210 Update
211#ifdef KOKKOS_ENABLE_CUDA
212 , typename std::enable_if<
213 !std::is_same<typename MatrixDevice::execution_space,Kokkos::Cuda>::value >::type
214#endif
215 >
216{
217public:
222
223 typedef typename MatrixDevice::execution_space execution_space;
224 typedef typename execution_space::size_type size_type;
225
226 typedef KokkosSparse::CrsMatrix< const MatrixValue,
227 MatrixOrdinal,
228 MatrixDevice,
229 MatrixMemory,
230 MatrixSize > matrix_type;
231 typedef typename matrix_type::values_type matrix_values_type;
232 typedef Kokkos::View< const InputVectorValue**,
233 InputP... > input_vector_type;
234 typedef Kokkos::View< OutputVectorValue**,
235 OutputP... > output_vector_type;
237
242
244 const input_vector_type & x,
245 const output_vector_type & y,
246 const update_type& update )
247 : m_A( A )
248 , m_x( x )
249 , m_y( y )
250 , m_update( update )
251 {}
252
253 KOKKOS_INLINE_FUNCTION
254 void operator()( const size_type iRow ) const
255 {
256 scalar_type sum;
257 // Loop over columns of x, y
258 const size_type num_col = m_y.extent(1);
259 for (size_type col=0; col<num_col; ++col) {
260 // Compute mat-vec for this row
261 const size_type iEntryBegin = m_A.graph.row_map[iRow];
262 const size_type iEntryEnd = m_A.graph.row_map[iRow+1];
263 sum = 0.0;
264 for (size_type iEntry = iEntryBegin; iEntry < iEntryEnd; ++iEntry) {
265 size_type iCol = m_A.graph.entries(iEntry);
266 sum += m_A.values(iEntry) * m_x(iCol,col);
267 }
268 m_update( m_y(iRow,col), sum );
269 } // x, y column loop
270 } // operator()
271
272public:
273
274 static void apply( const matrix_type & A,
275 const input_vector_type & x,
276 const output_vector_type & y,
277 const update_type & update )
278 {
279 const size_type row_count = A.graph.row_map.extent(0)-1;
280 Kokkos::parallel_for( row_count, MPMultiply(A,x,y,update) );
281 }
282};
283
284// Kernel implementing y = A * x where
285// A == KokkosSparse::CrsMatrix< Sacado::MP::Vector<...>,...>,
286// x, y == Kokkos::View< Sacado::MP::Vector<...>*,...>,
287// x and y are rank 1, any layout
288// We spell everything out here to make sure the ranks and devices match.
289//
290// This implementation uses overloaded operators for MP::Vector.
291template <typename MatrixDevice,
292 typename MatrixStorage,
293 typename MatrixOrdinal,
294 typename MatrixMemory,
295 typename MatrixSize,
296 typename InputStorage,
297 typename ... InputP,
298 typename OutputStorage,
299 typename ... OutputP,
300 typename Update>
301class MPMultiply< KokkosSparse::CrsMatrix< Sacado::MP::Vector<MatrixStorage>,
302 MatrixOrdinal,
303 MatrixDevice,
304 MatrixMemory,
305 MatrixSize>,
306 Kokkos::View< const Sacado::MP::Vector<InputStorage>*,
307 InputP... >,
308 Kokkos::View< Sacado::MP::Vector<OutputStorage>*,
309 OutputP... >,
310 Update
311 >
312{
313
314public:
315
320
321 typedef typename MatrixDevice::execution_space execution_space;
322 typedef typename execution_space::size_type size_type;
323
324 typedef KokkosSparse::CrsMatrix< MatrixValue,
325 MatrixOrdinal,
326 MatrixDevice,
327 MatrixMemory,
328 MatrixSize > matrix_type;
329 typedef typename matrix_type::const_type const_matrix_type;
330
331 typedef Kokkos::View< const InputVectorValue*,
332 InputP... > input_vector_type;
333 typedef Kokkos::View< OutputVectorValue*,
334 OutputP... > output_vector_type;
336
346};
347
348// Kernel implementing y = A * x where
349// A == KokkosSparse::CrsMatrix< Sacado::MP::Vector<...>,...>,
350// x, y == Kokkos::View< Sacado::MP::Vector<...>**,...>,
351// x and y are rank 2, any layout
352// We spell everything out here to make sure the ranks and devices match.
353//
354// This implementation uses overloaded operators for MP::Vector.
355template <typename MatrixDevice,
356 typename MatrixStorage,
357 typename MatrixOrdinal,
358 typename MatrixMemory,
359 typename MatrixSize,
360 typename InputStorage,
361 typename ... InputP,
362 typename OutputStorage,
363 typename ... OutputP,
364 typename Update>
365class MPMultiply< KokkosSparse::CrsMatrix< Sacado::MP::Vector<MatrixStorage>,
366 MatrixOrdinal,
367 MatrixDevice,
368 MatrixMemory,
369 MatrixSize>,
370 Kokkos::View< const Sacado::MP::Vector<InputStorage>**,
371 InputP... >,
372 Kokkos::View< Sacado::MP::Vector<OutputStorage>**,
373 OutputP... >,
374 Update
375 >
376{
377
378public:
379
384
385 typedef typename MatrixDevice::execution_space execution_space;
386 typedef typename execution_space::size_type size_type;
387
388 typedef KokkosSparse::CrsMatrix< MatrixValue,
389 MatrixOrdinal,
390 MatrixDevice,
391 MatrixMemory,
392 MatrixSize > matrix_type;
393 typedef typename matrix_type::const_type const_matrix_type;
394
395 typedef Kokkos::View< const InputVectorValue**,
396 InputP... > input_vector_type;
397 typedef Kokkos::View< OutputVectorValue**,
398 OutputP... > output_vector_type;
400
410};
411
412} // namespace details
413
414// Kernel implementing y = A * x where
415// A == KokkosSparse::CrsMatrix< Sacado::MP::Vector<...>,...>,
416// x, y == Kokkos::View< Sacado::MP::Vector<...>*,...>,
417// x and y are rank 1, any layout
418// We spell everything out here to make sure the ranks and devices match.
419//
420// This implementation uses overloaded operators for MP::Vector.
421template <typename MatrixDevice,
422 typename MatrixStorage,
423 typename MatrixOrdinal,
424 typename MatrixMemory,
425 typename MatrixSize,
426 typename InputStorage,
427 typename ... InputP,
428 typename OutputStorage,
429 typename ... OutputP>
430class Multiply< KokkosSparse::CrsMatrix< Sacado::MP::Vector<MatrixStorage>,
431 MatrixOrdinal,
432 MatrixDevice,
433 MatrixMemory,
434 MatrixSize >,
435 Kokkos::View< const Sacado::MP::Vector<InputStorage>*,
436 InputP... >,
437 Kokkos::View< Sacado::MP::Vector<OutputStorage>*,
438 OutputP... >
439 >
440{
441public:
445
446 typedef typename MatrixDevice::execution_space execution_space;
447 typedef typename execution_space::size_type size_type;
448
449 typedef KokkosSparse::CrsMatrix< MatrixValue,
450 MatrixOrdinal,
451 MatrixDevice,
452 MatrixMemory,
453 MatrixSize > matrix_type;
454 typedef typename matrix_type::values_type matrix_values_type;
455 typedef Kokkos::View< const InputVectorValue*,
456 InputP... > input_vector_type;
457 typedef Kokkos::View< OutputVectorValue*,
458 OutputP... > output_vector_type;
459
460public:
461
462 static void apply( const matrix_type & A,
463 const input_vector_type & x,
464 const output_vector_type & y )
465 {
467 multiply_type::apply(A,x,y,details::MultiplyAssign());
468 }
469};
470
471// Kernel implementing y = A * x where
472// A == KokkosSparse::CrsMatrix< Sacado::MP::Vector<...>,...>,
473// x, y == Kokkos::View< Sacado::MP::Vector<...>**,...>,
474// x and y are rank 2, any layout
475// We spell everything out here to make sure the ranks and devices match.
476//
477// This implementation uses overloaded operators for MP::Vector.
478template <typename MatrixDevice,
479 typename MatrixStorage,
480 typename MatrixOrdinal,
481 typename MatrixMemory,
482 typename MatrixSize,
483 typename InputStorage,
484 typename ... InputP,
485 typename OutputStorage,
486 typename ... OutputP>
487class Multiply< KokkosSparse::CrsMatrix< Sacado::MP::Vector<MatrixStorage>,
488 MatrixOrdinal,
489 MatrixDevice,
490 MatrixMemory,
491 MatrixSize >,
492 Kokkos::View< const Sacado::MP::Vector<InputStorage>**,
493 InputP... >,
494 Kokkos::View< Sacado::MP::Vector<OutputStorage>**,
495 OutputP... >
496 >
497{
498public:
502
503 typedef typename MatrixDevice::execution_space execution_space;
504 typedef typename execution_space::size_type size_type;
505
506 typedef KokkosSparse::CrsMatrix< MatrixValue,
507 MatrixOrdinal,
508 MatrixDevice,
509 MatrixMemory,
510 MatrixSize > matrix_type;
511 typedef typename matrix_type::values_type matrix_values_type;
512 typedef Kokkos::View< const InputVectorValue**,
513 InputP... > input_vector_type;
514 typedef Kokkos::View< OutputVectorValue**,
515 OutputP... > output_vector_type;
516
517public:
518
519 static void apply( const matrix_type & A,
520 const input_vector_type & x,
521 const output_vector_type & y )
522 {
524 multiply_type::apply(A,x,y,details::MultiplyAssign());
525 }
526};
527
528} // namespace Stokhos
529
530namespace KokkosSparse {
531
532template <typename AlphaType,
533 typename BetaType,
534 typename MatrixType,
535 typename InputType,
536 typename ... InputP,
537 typename OutputType,
538 typename ... OutputP>
539typename std::enable_if<
540 Kokkos::is_view_mp_vector< Kokkos::View< InputType, InputP... > >::value &&
541 Kokkos::is_view_mp_vector< Kokkos::View< OutputType, OutputP... > >::value
542 >::type
544 const char mode[],
545 const AlphaType& a,
546 const MatrixType& A,
547 const Kokkos::View< InputType, InputP... >& x,
548 const BetaType& b,
549 const Kokkos::View< OutputType, OutputP... >& y,
550 const RANK_ONE)
551{
552 typedef Kokkos::View< OutputType, OutputP... > OutputVectorType;
553 typedef Kokkos::View< InputType, InputP... > InputVectorType;
554 using input_vector_type = const_type_t<InputVectorType>;
555 typedef typename InputVectorType::array_type::non_const_value_type value_type;
556
557 if(mode[0]!='N') {
559 "Stokhos spmv not implemented for transposed or conjugated matrix-vector multiplies");
560 }
561
564 "MV_Multiply not implemented for non-constant a or b");
565 }
566
567 value_type aa = Sacado::Value<AlphaType>::eval(a);
568 value_type bb = Sacado::Value<BetaType>::eval(b);
569 if (bb == value_type(0)) {
570 if (aa == value_type(1)) {
571 // y = A*x
572 typedef Stokhos::details::MultiplyAssign UpdateType;
573 typedef Stokhos::details::MPMultiply<MatrixType,
574 input_vector_type, OutputVectorType,
575 UpdateType> multiply_type;
576 multiply_type::apply( A, x, y, UpdateType() );
577 }
578 else {
579 // y = a*A*x
581 typedef Stokhos::details::MPMultiply<MatrixType,
582 input_vector_type, OutputVectorType,
583 UpdateType> multiply_type;
584 multiply_type::apply( A, x, y, UpdateType(aa) );
585 }
586 }
587 else if (bb == value_type(1)) {
588 if (aa == value_type(1)) {
589 // y += A*x
590 typedef Stokhos::details::MultiplyUpdate UpdateType;
591 typedef Stokhos::details::MPMultiply<MatrixType,
592 input_vector_type, OutputVectorType,
593 UpdateType> multiply_type;
594 multiply_type::apply( A, x, y, UpdateType() );
595 }
596 else {
597 // y += a*A*x
599 typedef Stokhos::details::MPMultiply<MatrixType,
600 input_vector_type, OutputVectorType,
601 UpdateType> multiply_type;
602 multiply_type::apply( A, x, y, UpdateType(aa) );
603 }
604 }
605 else {
606 // y = a*A*x + b*y
608 typedef Stokhos::details::MPMultiply<MatrixType,
609 input_vector_type, OutputVectorType,
610 UpdateType> multiply_type;
611 multiply_type::apply( A, x, y, UpdateType(aa,bb) );
612 }
613}
614
615template <typename AlphaType,
616 typename BetaType,
617 typename MatrixType,
618 typename InputType,
619 typename ... InputP,
620 typename OutputType,
621 typename ... OutputP>
622typename std::enable_if<
623 Kokkos::is_view_mp_vector< Kokkos::View< InputType, InputP... > >::value &&
624 Kokkos::is_view_mp_vector< Kokkos::View< OutputType, OutputP... > >::value
625 >::type
627 KokkosKernels::Experimental::Controls,
628 const char mode[],
629 const AlphaType& a,
630 const MatrixType& A,
631 const Kokkos::View< InputType, InputP... >& x,
632 const BetaType& b,
633 const Kokkos::View< OutputType, OutputP... >& y,
634 const RANK_ONE)
635{
636 spmv(mode, a, A, x, b, y, RANK_ONE());
637}
638
639template <typename AlphaType,
640 typename BetaType,
641 typename MatrixType,
642 typename InputType,
643 typename ... InputP,
644 typename OutputType,
645 typename ... OutputP>
646typename std::enable_if<
647 Kokkos::is_view_mp_vector< Kokkos::View< InputType, InputP... > >::value &&
648 Kokkos::is_view_mp_vector< Kokkos::View< OutputType, OutputP... > >::value
649 >::type
651 const char mode[],
652 const AlphaType& a,
653 const MatrixType& A,
654 const Kokkos::View< InputType, InputP... >& x,
655 const BetaType& b,
656 const Kokkos::View< OutputType, OutputP... >& y,
657 const RANK_TWO)
658{
659 if(mode[0]!='N') {
661 "Stokhos spmv not implemented for transposed or conjugated matrix-vector multiplies");
662 }
663 if (y.extent(1) == 1) {
664 auto y_1D = subview(y, Kokkos::ALL(), 0);
665 auto x_1D = subview(x, Kokkos::ALL(), 0);
666 spmv(mode, a, A, x_1D, b, y_1D, RANK_ONE());
667 }
668 else {
669 typedef Kokkos::View< OutputType, OutputP... > OutputVectorType;
670 typedef Kokkos::View< InputType, InputP... > InputVectorType;
671 using input_vector_type = const_type_t<InputVectorType>;
672 typedef typename InputVectorType::array_type::non_const_value_type value_type;
673
676 "Stokhos spmv not implemented for non-constant a or b");
677 }
678
679 value_type aa = Sacado::Value<AlphaType>::eval(a);
680 value_type bb = Sacado::Value<BetaType>::eval(b);
681 if (bb == value_type(0)) {
682 if (aa == value_type(1)) {
683 // y = A*x
684 typedef Stokhos::details::MultiplyAssign UpdateType;
685 typedef Stokhos::details::MPMultiply<MatrixType,
686 input_vector_type, OutputVectorType,
687 UpdateType> multiply_type;
688 multiply_type::apply( A, x, y, UpdateType() );
689 }
690 else {
691 // y = a*A*x
693 typedef Stokhos::details::MPMultiply<MatrixType,
694 input_vector_type, OutputVectorType,
695 UpdateType> multiply_type;
696 multiply_type::apply( A, x, y, UpdateType(aa) );
697 }
698 }
699 else if (bb == value_type(1)) {
700 if (aa == value_type(1)) {
701 // y += A*x
702 typedef Stokhos::details::MultiplyUpdate UpdateType;
703 typedef Stokhos::details::MPMultiply<MatrixType,
704 input_vector_type, OutputVectorType,
705 UpdateType> multiply_type;
706 multiply_type::apply( A, x, y, UpdateType() );
707 }
708 else {
709 // y += a*A*x
711 typedef Stokhos::details::MPMultiply<MatrixType,
712 input_vector_type, OutputVectorType,
713 UpdateType> multiply_type;
714 multiply_type::apply( A, x, y, UpdateType(aa) );
715 }
716 }
717 else {
718 // y = a*A*x + b*y
720 typedef Stokhos::details::MPMultiply<MatrixType,
721 input_vector_type, OutputVectorType,
722 UpdateType> multiply_type;
723 multiply_type::apply( A, x, y, UpdateType(aa,bb) );
724 }
725 }
726}
727
728template <typename AlphaType,
729 typename BetaType,
730 typename MatrixType,
731 typename InputType,
732 typename ... InputP,
733 typename OutputType,
734 typename ... OutputP>
735typename std::enable_if<
736 Kokkos::is_view_mp_vector< Kokkos::View< InputType, InputP... > >::value &&
737 Kokkos::is_view_mp_vector< Kokkos::View< OutputType, OutputP... > >::value
738 >::type
740 KokkosKernels::Experimental::Controls,
741 const char mode[],
742 const AlphaType& a,
743 const MatrixType& A,
744 const Kokkos::View< InputType, InputP... >& x,
745 const BetaType& b,
746 const Kokkos::View< OutputType, OutputP... >& y,
747 const RANK_TWO)
748{
749 spmv(mode, a, A, x, b, y, RANK_TWO());
750}
751
752}
753
754#endif /* #ifndef KOKKOS_CRSMATRIX_MP_VECTOR_HPP */
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< InputType, InputP... > >::value &&Kokkos::is_view_uq_pce< Kokkos::View< OutputType, OutputP... > >::value >::type spmv(const char mode[], const AlphaType &a, const MatrixType &A, const Kokkos::View< InputType, InputP... > &x, const BetaType &b, const Kokkos::View< OutputType, OutputP... > &y, const RANK_ONE)
KOKKOS_INLINE_FUNCTION void raise_error(const char *msg)
KOKKOS_INLINE_FUNCTION bool is_constant(const T &x)
Top-level namespace for Stokhos classes and functions.
void update(const ValueType &alpha, VectorType &x, const ValueType &beta, const VectorType &y)