Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Kokkos_Blas1_UQ_PCE.hpp
Go to the documentation of this file.
1 // @HEADER
2 // *****************************************************************************
3 // Stokhos Package
4 //
5 // Copyright 2009 NTESS and the Stokhos contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9 
10 #ifndef KOKKOS_BLAS1_UQ_PCE_HPP
11 #define KOKKOS_BLAS1_UQ_PCE_HPP
12 
13 #include "Sacado_UQ_PCE.hpp"
14 #include "Kokkos_View_UQ_PCE.hpp"
16 #include "KokkosBlas.hpp"
17 
18 //----------------------------------------------------------------------------
19 // Specializations of Kokkos Vector/MultiVector math functions
20 //----------------------------------------------------------------------------
21 
22 namespace KokkosBlas {
23 
24 template <typename XD, typename ... XP,
25  typename YD, typename ... YP>
26 typename std::enable_if<
27  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value &&
28  Kokkos::is_view_uq_pce< Kokkos::View<YD,YP...> >::value,
29  typename Kokkos::Details::InnerProductSpaceTraits<
30  typename Kokkos::View<XD,XP...>::non_const_value_type >::dot_type
31  >::type
32 dot(const Kokkos::View<XD,XP...>& x,
33  const Kokkos::View<YD,YP...>& y)
34 {
35  typedef Kokkos::View<XD,XP...> XVector;
36  typedef Kokkos::View<YD,YP...> YVector;
37 
38  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
39  typename Kokkos::FlatArrayType<YVector>::type y_flat = y;
40 
41  return dot( x_flat, y_flat );
42 }
43 
44 template <typename RV,
45  typename XD, typename ... XP,
46  typename YD, typename ... YP>
47 typename std::enable_if<
48  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value &&
49  Kokkos::is_view_uq_pce< Kokkos::View<YD,YP...> >::value >::type
50 dot(const RV& r,
51  const Kokkos::View<XD,XP...>& x,
52  const Kokkos::View<YD,YP...>& y)
53 {
54  typedef Kokkos::View<XD,XP...> XVector;
55  typedef Kokkos::View<YD,YP...> YVector;
56 
57  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
58  typename Kokkos::FlatArrayType<YVector>::type y_flat = y;
59 
60  dot( r, x_flat, y_flat );
61 }
62 
63 template <typename XD, typename ... XP>
64 typename std::enable_if<
65  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value >::type
66 fill(const Kokkos::View<XD,XP...>& x,
67  const typename Kokkos::View<XD,XP...>::non_const_value_type& val) {
68  typedef Kokkos::View<XD,XP...> XVector;
69 
70  // Use the existing fill() implementation if we can
71  if (Sacado::is_constant(val)) {
72  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
73  fill( x_flat, val.coeff(0) );
74  }
75  else {
76  Kokkos::deep_copy(x, val);
77  }
78 }
79 
80 template <typename RV,
81  typename XD, typename ... XP>
82 typename std::enable_if<
83  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value >::type
85  const RV& r,
86  const Kokkos::View<XD,XP...>& x)
87 {
88  typedef Kokkos::View<XD,XP...> XVector;
89 
90  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
91 
92  nrm2_squared( r, x_flat );
93 }
94 
95 template <typename RV,
96  typename XD, typename ... XP>
97 typename std::enable_if<
98  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value >::type
100  const RV& r,
101  const Kokkos::View<XD,XP...>& x)
102 {
103  typedef Kokkos::View<XD,XP...> XVector;
104 
105  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
106 
107  nrm1( r, x_flat );
108 }
109 
110 template <typename RV,
111  typename XD, typename ... XP>
112 typename std::enable_if<
113  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value >::type
115  const RV& r,
116  const Kokkos::View<XD,XP...>& x)
117 {
118  typedef Kokkos::View<XD,XP...> XVector;
119 
120  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
121 
122  nrmInf( r, x_flat );
123 }
124 
125 template <typename AV,
126  typename XD, typename ... XP,
127  typename BV,
128  typename YD, typename ... YP>
129 typename std::enable_if<
130  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value &&
131  Kokkos::is_view_uq_pce< Kokkos::View<YD,YP...> >::value >::type
132 axpby(const AV& a,
133  const Kokkos::View<XD,XP...>& x,
134  const BV& b,
135  const Kokkos::View<YD,YP...>& y)
136 {
137  typedef Kokkos::View<XD,XP...> XVector;
138  typedef Kokkos::View<YD,YP...> YVector;
139 
140  if (!Sacado::is_constant(a) || !Sacado::is_constant(b)) {
141  Kokkos::Impl::raise_error("axpby not implemented for non-constant a or b");
142  }
143 
144  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
145  typename Kokkos::FlatArrayType<YVector>::type y_flat = y;
146  auto aa = Sacado::Value<AV>::eval(a);
147  auto bb = Sacado::Value<BV>::eval(b);
148  axpby( aa, x_flat, bb, y_flat );
149 }
150 
151 // Currently not handling scal() when AV is a view
152 
153 template <typename RD, typename ... RP,
154  typename XD, typename ... XP>
155 typename std::enable_if<
156  Kokkos::is_view_uq_pce< Kokkos::View<RD,RP...> >::value &&
157  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value >::type
158 scal(const Kokkos::View<RD,RP...>& r,
159  const typename Kokkos::View<XD,XP...>::non_const_value_type& a,
160  const Kokkos::View<XD,XP...>& x)
161 {
162  typedef Kokkos::View<RD,RP...> RVector;
163  typedef Kokkos::View<XD,XP...> XVector;
164 
165  if (!Sacado::is_constant(a)) {
166  Kokkos::Impl::raise_error("scal not implemented for non-constant a");
167  }
168 
169  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
170  typename Kokkos::FlatArrayType<RVector>::type r_flat = r;
171  scal( r_flat, a.coeff(0), x_flat );
172 }
173 
174 // abs -- can't do this one by flattening. Hold out for refactoring of scalar
175 // types in Kokkos
176 
177 // We have a special verision of update for scalar alpha/beta/gamma since it
178 // is used in TrilinosCouplings CG solve (even though Tpetra doesn't).
179 template <typename XD, typename ... XP,
180  typename YD, typename ... YP,
181  typename ZD, typename ... ZP>
182 typename std::enable_if<
183  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value &&
184  Kokkos::is_view_uq_pce< Kokkos::View<YD,YP...> >::value &&
185  Kokkos::is_view_uq_pce< Kokkos::View<ZD,ZP...> >::value >::type
187  const typename Kokkos::View<XD,XP...>::array_type::non_const_value_type& alpha,
188  const Kokkos::View<XD,XP...>& x,
189  const typename Kokkos::View<YD,YP...>::array_type::non_const_value_type& beta,
190  const Kokkos::View<YD,YP...>& y,
191  const typename Kokkos::View<ZD,ZP...>::array_type::non_const_value_type& gamma,
192  const Kokkos::View<ZD,ZP...>& z)
193 {
194  typedef Kokkos::View<XD,XP...> XVector;
195  typedef Kokkos::View<YD,YP...> YVector;
196  typedef Kokkos::View<ZD,ZP...> ZVector;
197 
198  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
199  typename Kokkos::FlatArrayType<YVector>::type y_flat = y;
200  typename Kokkos::FlatArrayType<ZVector>::type z_flat = z;
201 
202  update( alpha, x_flat, beta, y_flat, gamma, z_flat);
203 
204 }
205 
206 template <typename XD, typename ... XP,
207  typename YD, typename ... YP,
208  typename ZD, typename ... ZP>
209 typename std::enable_if<
210  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value &&
211  Kokkos::is_view_uq_pce< Kokkos::View<YD,YP...> >::value &&
212  Kokkos::is_view_uq_pce< Kokkos::View<ZD,ZP...> >::value >::type
214  const typename Kokkos::View<XD,XP...>::non_const_value_type& alpha,
215  const Kokkos::View<XD,XP...>& x,
216  const typename Kokkos::View<YD,YP...>::non_const_value_type& beta,
217  const Kokkos::View<YD,YP...>& y,
218  const typename Kokkos::View<ZD,ZP...>::non_const_value_type& gamma,
219  const Kokkos::View<ZD,ZP...>& z)
220 {
221  if (!Sacado::is_constant(alpha) || !Sacado::is_constant(beta) ||
222  !Sacado::is_constant(gamma)) {
224  "update not implemented for non-constant alpha, beta, gamma");
225  }
226 
227  update( alpha.coeff(0), x, beta.coeff(0), y, gamma.coeff(0), z );
228 }
229 
230 // Mean-based implementation of reciprocal()
231 namespace Impl {
232 
233 template<class RS, class ... RP,
234  class XS, class ... XP,
235  class SizeType>
236 struct MV_Reciprocal_Functor<
237  Kokkos::View<Sacado::UQ::PCE<RS>**,RP...>,
238  Kokkos::View<const Sacado::UQ::PCE<XS>**,XP...>,
239  SizeType>
240 {
241  typedef Kokkos::View<Sacado::UQ::PCE<RS>**,RP...> RMV;
242  typedef Kokkos::View<const Sacado::UQ::PCE<XS>**,XP...> XMV;
244  typedef SizeType size_type;
245 #if KOKKOS_VERSION >= 40799
246  typedef KokkosKernels::ArithTraits<typename Kokkos::IntrinsicScalarType<XMV>::type> ATS;
247 #else
248  typedef Kokkos::ArithTraits<typename Kokkos::IntrinsicScalarType<XMV>::type> ATS;
249 #endif
250 
254 
255  MV_Reciprocal_Functor (const RMV& R, const XMV& X) :
256  numCols (X.extent(1)), R_ (R), X_ (X)
257  {
258  }
259 
260  KOKKOS_INLINE_FUNCTION
261  void operator() (const size_type& i) const
262  {
263 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
264 #pragma ivdep
265 #endif
266  for (size_type j = 0; j < numCols; ++j) {
267  R_(i,j) = ATS::one () / X_(i,j).fastAccessCoeff(0);
268  }
269  }
270 };
271 
272 template<class RS, class ... RP,
273  class SizeType>
274 struct MV_ReciprocalSelf_Functor<
275  Kokkos::View<Sacado::UQ::PCE<RS>**,RP...>,
276  SizeType>
277 {
278  typedef Kokkos::View<Sacado::UQ::PCE<RS>**,RP...> RMV;
280  typedef SizeType size_type;
281 #if KOKKOS_VERSION >= 40799
282  typedef KokkosKernels::ArithTraits<typename Kokkos::IntrinsicScalarType<RMV>::type> ATS;
283 #else
284  typedef Kokkos::ArithTraits<typename Kokkos::IntrinsicScalarType<RMV>::type> ATS;
285 #endif
286 
289 
291  numCols (R.extent(1)), R_ (R)
292  {
293  }
294 
295  KOKKOS_INLINE_FUNCTION
296  void operator() (const size_type& i) const
297  {
298 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
299 #pragma ivdep
300 #endif
301  for (size_type j = 0; j < numCols; ++j) {
302  R_(i,j) = ATS::one () / R_(i,j).fastAccessCoeff(0);
303  }
304  }
305 };
306 
307 template<class RS, class ... RP,
308  class XS, class ... XP,
309  class SizeType>
310 struct V_Reciprocal_Functor<
311  Kokkos::View<Sacado::UQ::PCE<RS>*,RP...>,
312  Kokkos::View<const Sacado::UQ::PCE<XS>*,XP...>,
313  SizeType>
314 {
315  typedef Kokkos::View<Sacado::UQ::PCE<RS>*,RP...> RV;
316  typedef Kokkos::View<const Sacado::UQ::PCE<XS>*,XP...> XV;
318  typedef SizeType size_type;
319 #if KOKKOS_VERSION >= 40799
320  typedef KokkosKernels::ArithTraits<typename Kokkos::IntrinsicScalarType<XV>::type> ATS;
321 #else
322  typedef Kokkos::ArithTraits<typename Kokkos::IntrinsicScalarType<XV>::type> ATS;
323 #endif
324 
327 
328  V_Reciprocal_Functor (const RV& R, const XV& X) : R_ (R), X_ (X)
329  {
330  }
331 
332  KOKKOS_INLINE_FUNCTION
333  void operator() (const size_type& i) const
334  {
335  R_(i) = ATS::one () / X_(i).fastAccessCoeff(0);
336  }
337 };
338 
339 template<class RS, class ... RP,
340  class SizeType>
341 struct V_ReciprocalSelf_Functor<
342  Kokkos::View<Sacado::UQ::PCE<RS>*,RP...>,
343  SizeType>
344 {
345  typedef Kokkos::View<Sacado::UQ::PCE<RS>*,RP...> RV;
347  typedef SizeType size_type;
348 #if KOKKOS_VERSION >= 40799
349  typedef KokkosKernels::ArithTraits<typename Kokkos::IntrinsicScalarType<RV>::type> ATS;
350 #else
351  typedef Kokkos::ArithTraits<typename Kokkos::IntrinsicScalarType<RV>::type> ATS;
352 #endif
353 
355 
356  V_ReciprocalSelf_Functor (const RV& R) : R_ (R)
357  {
358  }
359 
360  KOKKOS_INLINE_FUNCTION
361  void operator() (const size_type& i) const
362  {
363  R_(i) = ATS::one () / R_(i).fastAccessCoeff(0);
364  }
365 };
366 
367 } // namespace Impl
368 
369 template <typename RD, typename ... RP,
370  typename XD, typename ... XP>
371 typename std::enable_if<
372  Kokkos::is_view_uq_pce< Kokkos::View<RD,RP...> >::value &&
373  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value >::type
375  const Kokkos::View<RD,RP...>& r,
376  const Kokkos::View<XD,XP...>& x)
377 {
378  typedef Kokkos::View<RD,RP...> RVector;
379  typedef Kokkos::View<XD,XP...> XVector;
380 
381  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
382  typename Kokkos::FlatArrayType<RVector>::type r_flat = r;
383  sum( r_flat, x_flat );
384 }
385 
386 template <typename RD, typename ... RP,
387  typename XD, typename ... XP,
388  typename WD, typename ... WP>
389 typename std::enable_if<
390  Kokkos::is_view_uq_pce< Kokkos::View<RD,RP...> >::value &&
391  Kokkos::is_view_uq_pce< Kokkos::View<XD,XP...> >::value &&
392  Kokkos::is_view_uq_pce< Kokkos::View<WD,WP...> >::value >::type
394  const Kokkos::View<RD,RP...>& r,
395  const Kokkos::View<XD,XP...>& x,
396  const Kokkos::View<WD,WP...>& w)
397 {
398  typedef Kokkos::View<RD,RP...> RVector;
399  typedef Kokkos::View<XD,XP...> XVector;
400  typedef Kokkos::View<WD,WP...> WVector;
401 
402  typename Kokkos::FlatArrayType<XVector>::type x_flat = x;
403  typename Kokkos::FlatArrayType<RVector>::type r_flat = r;
404  typename Kokkos::FlatArrayType<WVector>::type w_flat = w;
405  nrm2w_squared( r_flat, x_flat, w_flat );
406 }
407 
408 // Mean-based implementation of mult()
409 namespace Impl {
410 
411 template<class CS, class ... CP,
412  class AS, class ... AP,
413  class BS, class ... BP,
414  int scalar_ab, int scalar_c, class SizeType>
415 struct MV_MultFunctor<
416  Kokkos::View<Sacado::UQ::PCE<CS>**,CP...>,
417  Kokkos::View<const Sacado::UQ::PCE<AS>*,AP...>,
418  Kokkos::View<const Sacado::UQ::PCE<BS>**,BP...>,
419  scalar_ab, scalar_c, SizeType>
420 {
421  typedef Kokkos::View<Sacado::UQ::PCE<CS>**,CP...> CMV;
422  typedef Kokkos::View<const Sacado::UQ::PCE<AS>*,AP...> AV;
423  typedef Kokkos::View<const Sacado::UQ::PCE<BS>**,BP...> BMV;
425  typedef SizeType size_type;
426 #if KOKKOS_VERSION >= 40799
427  typedef KokkosKernels::ArithTraits<typename Kokkos::IntrinsicScalarType<CMV>::type> ATS;
428 #else
429  typedef Kokkos::ArithTraits<typename Kokkos::IntrinsicScalarType<CMV>::type> ATS;
430 #endif
431 
432  const size_type m_n;
439 
440  MV_MultFunctor (typename CMV::const_value_type& c,
441  const CMV& C,
442  typename AV::const_value_type& ab,
443  const AV& A,
444  const BMV& B) :
445  m_n (C.extent(1)),
446  m_pce (dimension_scalar(C)),
447  m_c (c.coeff(0)), m_C (C), m_ab (ab.coeff(0)), m_A (A), m_B (B)
448  {
449  if (!Sacado::is_constant(c) || !Sacado::is_constant(ab)) {
450  Kokkos::Impl::raise_error("mult not implemented for non-constant c, ab");
451  }
452  }
453 
454  KOKKOS_INLINE_FUNCTION void
455  operator () (const size_type& i) const
456  {
457  if (scalar_c == 0) {
458  if (scalar_ab == 0) {
459  for (size_type j = 0; j < m_n; ++j) {
460 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
461 #pragma ivdep
462 #endif
463  for (size_type l=0; l<m_pce; ++l)
464  m_C(i,j).fastAccessCoeff(l) = ATS::zero ();
465  }
466  }
467  else { // ab != 0, c == 0
468  typename Kokkos::IntrinsicScalarType<AV>::type Ai = m_A(i).fastAccessCoeff(0);
469  for (size_type j = 0; j < m_n; ++j) {
470 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
471 #pragma ivdep
472 #endif
473  for (size_type l=0; l<m_pce; ++l)
474  m_C(i,j).fastAccessCoeff(l) =
475  m_ab * Ai * m_B(i,j).fastAccessCoeff(l);
476  }
477  }
478  } else { // c != 0
479  if (scalar_ab == 0) {
480  for (size_type j = 0; j < m_n; ++j) {
481 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
482 #pragma ivdep
483 #endif
484  for (size_type l=0; l<m_pce; ++l)
485  m_C(i,j).fastAccessCoeff(l) = m_c * m_C(i,j).fastAccessCoeff(l);
486  }
487  }
488  else { // m_ab != 0, and m_c != 0
489  typename Kokkos::IntrinsicScalarType<AV>::type Ai = m_A(i).fastAccessCoeff(0);
490  for (size_type j = 0; j < m_n; ++j) {
491 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
492 #pragma ivdep
493 #endif
494  for (size_type l=0; l<m_pce; ++l)
495  m_C(i,j).fastAccessCoeff(l) =
496  m_c * m_C(i,j).fastAccessCoeff(l) + m_ab * Ai * m_B(i,j).fastAccessCoeff(l);
497  }
498  }
499  }
500  }
501 };
502 
503 template<class CS, class ... CP,
504  class AS, class ... AP,
505  class BS, class ... BP,
506  int scalar_ab, int scalar_c, class SizeType>
507 struct V_MultFunctor<
508  Kokkos::View<Sacado::UQ::PCE<CS>*,CP...>,
509  Kokkos::View<const Sacado::UQ::PCE<AS>*,AP...>,
510  Kokkos::View<const Sacado::UQ::PCE<BS>*,BP...>,
511  scalar_ab, scalar_c, SizeType>
512 {
513  typedef Kokkos::View<Sacado::UQ::PCE<CS>*,CP...> CV;
514  typedef Kokkos::View<const Sacado::UQ::PCE<AS>*,AP...> AV;
515  typedef Kokkos::View<const Sacado::UQ::PCE<BS>*,BP...> BV;
517  typedef SizeType size_type;
518 #if KOKKOS_VERSION >= 40799
519  typedef KokkosKernels::ArithTraits<typename Kokkos::IntrinsicScalarType<CV>::type> ATS;
520 #else
521  typedef Kokkos::ArithTraits<typename Kokkos::IntrinsicScalarType<CV>::type> ATS;
522 #endif
523 
530 
531  V_MultFunctor (typename CV::const_value_type& c,
532  const CV& C,
533  typename AV::const_value_type& ab,
534  const AV& A,
535  const BV& B) :
536  m_pce (dimension_scalar(C)),
537  m_c (c.coeff(0)), m_C (C), m_ab (ab.coeff(0)), m_A (A), m_B (B)
538  {
539  if (!Sacado::is_constant(c) || !Sacado::is_constant(ab)) {
540  Kokkos::Impl::raise_error("mult not implemented for non-constant c, ab");
541  }
542  }
543 
544  KOKKOS_INLINE_FUNCTION void
545  operator () (const size_type& i) const
546  {
547  if (scalar_c == 0) {
548  if (scalar_ab == 0) {
549 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
550 #pragma ivdep
551 #endif
552  for (size_type l=0; l<m_pce; ++l)
553  m_C(i).fastAccessCoeff(l) = ATS::zero ();
554  }
555  else { // ab != 0, c == 0
556  typename Kokkos::IntrinsicScalarType<AV>::type Ai = m_A(i).fastAccessCoeff(0);
557 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
558 #pragma ivdep
559 #endif
560  for (size_type l=0; l<m_pce; ++l)
561  m_C(i).fastAccessCoeff(l) = m_ab * Ai * m_B(i).fastAccessCoeff(l);
562  }
563  } else { // c != 0
564  if (scalar_ab == 0) {
565 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
566 #pragma ivdep
567 #endif
568  for (size_type l=0; l<m_pce; ++l)
569  m_C(i).fastAccessCoeff(l) = m_c * m_C(i).fastAccessCoeff(l);
570  }
571  else { // m_ab != 0, and m_c != 0
572  typename Kokkos::IntrinsicScalarType<AV>::type Ai = m_A(i).fastAccessCoeff(0);
573 #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP
574 #pragma ivdep
575 #endif
576  for (size_type l=0; l<m_pce; ++l)
577  m_C(i).fastAccessCoeff(l) =
578  m_c * m_C(i).fastAccessCoeff(l) + m_ab * Ai * m_B(i).fastAccessCoeff(l);
579  }
580  }
581  }
582 };
583 
584 } // namespace Impl
585 
586 } // namespace KokkosBlas
587 
588 #endif /* #ifndef KOKKOS_MV_UQ_PCE_HPP */
Kokkos::DefaultExecutionSpace execution_space
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type fill(const Kokkos::View< XD, XP...> &x, const typename Kokkos::View< XD, XP...>::non_const_value_type &val)
KOKKOS_INLINE_FUNCTION void raise_error(const char *msg)
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< is_view_uq_pce< View< T, P...> >::value, unsigned >::type dimension_scalar(const View< T, P...> &view)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< YD, YP...> >::value, typename Kokkos::Details::InnerProductSpaceTraits< typename Kokkos::View< XD, XP...>::non_const_value_type >::dot_type >::type dot(const Kokkos::View< XD, XP...> &x, const Kokkos::View< YD, YP...> &y)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type nrm1(const RV &r, const Kokkos::View< XD, XP...> &x)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< RD, RP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< WD, WP...> >::value >::type nrm2w_squared(const Kokkos::View< RD, RP...> &r, const Kokkos::View< XD, XP...> &x, const Kokkos::View< WD, WP...> &w)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type nrm2_squared(const RV &r, const Kokkos::View< XD, XP...> &x)
KOKKOS_INLINE_FUNCTION bool is_constant(const T &x)
void deep_copy(const Stokhos::CrsMatrix< ValueType, DstDevice, Layout > &dst, const Stokhos::CrsMatrix< ValueType, SrcDevice, Layout > &src)
view_type::array_type::non_const_value_type type
expr val()
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< YD, YP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< ZD, ZP...> >::value >::type update(const typename Kokkos::View< XD, XP...>::array_type::non_const_value_type &alpha, const Kokkos::View< XD, XP...> &x, const typename Kokkos::View< YD, YP...>::array_type::non_const_value_type &beta, const Kokkos::View< YD, YP...> &y, const typename Kokkos::View< ZD, ZP...>::array_type::non_const_value_type &gamma, const Kokkos::View< ZD, ZP...> &z)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type nrmInf(const RV &r, const Kokkos::View< XD, XP...> &x)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< YD, YP...> >::value >::type axpby(const AV &a, const Kokkos::View< XD, XP...> &x, const BV &b, const Kokkos::View< YD, YP...> &y)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< RD, RP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type scal(const Kokkos::View< RD, RP...> &r, const typename Kokkos::View< XD, XP...>::non_const_value_type &a, const Kokkos::View< XD, XP...> &x)
std::enable_if< Kokkos::is_view_uq_pce< Kokkos::View< RD, RP...> >::value &&Kokkos::is_view_uq_pce< Kokkos::View< XD, XP...> >::value >::type sum(const Kokkos::View< RD, RP...> &r, const Kokkos::View< XD, XP...> &x)