Stokhos Package Browser (Single Doxygen Collection)  Version of the Day
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Kokkos_View_MP_Vector_Interlaced.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_VIEW_MP_VECTOR_INTERLACED_HPP
11 #define KOKKOS_VIEW_MP_VECTOR_INTERLACED_HPP
12 
13 #include "Sacado_MP_Vector.hpp"
15 #include "Stokhos_ViewStorage.hpp"
16 #include <Kokkos_Core.hpp>
17 
18 #include "Kokkos_View_Utils.hpp"
20 
21 /*
22  * Specialization for Kokkos::View<Sacado::MP::Vector<Storage>...>
23  * where the Sacado dimension is interlaced for LayoutLeft.
24  *
25  * Currently it can't be used at the same time as other such View
26  * specializations due to conflicting specializations of AnalyzeShape.
27  */
28 
29 namespace Kokkos {
30 namespace Impl {
31 
33 
34 template< class ValueType , class MemorySpace , class MemoryTraits >
35 struct ViewSpecialize
36  < ValueType
38  , LayoutLeft
39  , MemorySpace
40  , MemoryTraits >
41 {
43 };
44 
45 template< class ValueType , class MemorySpace , class MemoryTraits >
46 struct ViewSpecialize
47  < ValueType
49  , LayoutRight
50  , MemorySpace
51  , MemoryTraits >
52 {
54 };
55 
56 } // namespace Impl
57 } // namespace Kokkos
58 
59 //----------------------------------------------------------------------------
60 //----------------------------------------------------------------------------
61 
62 namespace Kokkos {
63 namespace Impl {
64 namespace ViewError {
65 
67 
68 } // namespace ViewError
69 } // namespace Impl
70 } // namespace Kokkos
71 
72 //----------------------------------------------------------------------------
73 //----------------------------------------------------------------------------
74 
75 namespace Kokkos {
76 
78 template< class DataType ,
79  class Arg1Type ,
80  class Arg2Type ,
81  class Arg3Type >
82 class View< DataType , Arg1Type , Arg2Type , Arg3Type , Impl::ViewMPVectorInterlaced >
83  : public ViewTraits< DataType
84  , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::array_layout
85  , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::device_type
86  , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::memory_traits
87  >
88 {
89 public:
90 
91  typedef ViewTraits< DataType
92  , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::array_layout
93  , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::device_type
94  , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::memory_traits
95  > traits ;
96 
97  // Type of const views with same value type
98  typedef View< typename traits::const_data_type ,
99  typename traits::array_layout ,
100  typename traits::device_type ,
101  typename traits::memory_traits > const_type ;
102 
103  // Type of non-const views with same value type
104  typedef View< typename traits::non_const_data_type ,
105  typename traits::array_layout ,
106  typename traits::device_type ,
107  typename traits::memory_traits > non_const_type ;
108 
109  // Host mirror
110  typedef View< typename Impl::RebindStokhosStorageDevice<
111  typename traits::data_type ,
112  typename traits::host_mirror_space::memory_space >::type ,
113  typename traits::array_layout ,
114  typename traits::host_mirror_space ,
116 
117  // host_mirror_type
118  typedef HostMirror host_mirror_type ;
119 
120  // Equivalent array type for this view.
121  typedef View< typename traits::array_type ,
122  typename traits::array_layout ,
123  typename traits::device_type ,
124  typename traits::memory_traits > array_type ;
125 
126  // Equivalent const array type for this view.
127  typedef View< typename traits::const_array_type ,
128  typename traits::array_layout ,
129  typename traits::device_type ,
130  typename traits::memory_traits > const_array_type ;
131 
132  // Equivalent host array type for this view.
133  typedef View< typename traits::array_type ,
134  typename traits::array_layout ,
135  typename traits::host_mirror_space ,
136  typename traits::memory_traits > host_array_type ;
137 
138  // Equivalent const host array type for this view.
139  typedef View< typename traits::const_array_type ,
140  typename traits::array_layout ,
141  typename traits::host_mirror_space ,
142  typename traits::memory_traits > host_const_array_type ;
143 
147 
148 private:
149 
150  // Assignment of compatible views requirement:
151  template< class , class , class , class , class > friend class View ;
152 
153  // Assignment of compatible subview requirement:
154  template< class , class , class > friend struct Impl::ViewAssignment ;
155 
156  enum { StokhosStorageStaticDimension = stokhos_storage_type::static_size };
157  typedef integral_nonzero_constant< unsigned , StokhosStorageStaticDimension > sacado_size_type;
158 
159  typedef Impl::LayoutStride< typename traits::shape_type ,
160  typename traits::array_layout > stride_type ;
161  typedef typename array_type::traits::shape_type array_shape_type;
162 
164  typename traits::shape_type m_shape ;
165  array_shape_type m_array_shape ; // Shape of intrinsic array
167  typename traits::execution_space::size_type m_storage_size ; // Storage size of sacado dimension
168  sacado_size_type m_sacado_size ; // Size of sacado dimension
169  Impl::ViewDataManagement< traits > m_management ;
170  Impl::AllocationTracker m_tracker ;
171  // Note: if the view is partitioned, m_sacado_size != m_storage_size.
172  // We always have m_storage_size >= m_sacado_size
173 
174  typedef Stokhos::ViewStorage<
177  StokhosStorageStaticDimension ,
178  /* LayoutRight has stride-one stokhos storage */
179  ( Impl::is_same< typename traits::array_layout , LayoutRight >::value ? 1 : 0 ) ,
180  typename traits::device_type > stokhos_view_storage_type ;
181 
182 public:
183 
184  // This needs to be public so that we know what the return type of () is
186 
187  // Whether the storage type is statically sized
188  static const bool is_static = stokhos_storage_type::is_static;
189 
190  // Whether sacado dimension is contiguous
191  static const bool is_contiguous =
192  Impl::is_same< typename traits::array_layout , LayoutRight >::value;
193 
194  //------------------------------------
195  // Shape for the Sacado::MP::Vector value_type ignores the internal static array length.
196  enum { Rank = traits::rank };
197 
198  // Rank corresponding to the sacado dimension
199  enum { Sacado_Rank = Rank+1 };
200 
201  KOKKOS_FORCEINLINE_FUNCTION typename traits::shape_type shape() const { return m_shape ; }
202  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_0() const { return m_shape.N0 ; }
203  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_1() const { return m_shape.N1 ; }
204  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_2() const { return m_shape.N2 ; }
205  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_3() const { return m_shape.N3 ; }
206  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_4() const { return m_shape.N4 ; }
207  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_5() const { return m_shape.N5 ; }
208  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_6() const { return m_shape.N6 ; }
209  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type dimension_7() const { return m_shape.N7 ; }
210  KOKKOS_FORCEINLINE_FUNCTION typename traits::size_type size() const
211  {
212  return m_shape.N0
213  * m_shape.N1
214  * m_shape.N2
215  * m_shape.N3
216  * m_shape.N4
217  * m_shape.N5
218  * m_shape.N6
219  * m_shape.N7
220  ;
221  }
222 
223  template< typename iType >
224  KOKKOS_FORCEINLINE_FUNCTION
225  typename traits::size_type dimension( const iType & i ) const
226  { return Impl::dimension( m_shape , i ); }
227 
228  //------------------------------------
229 
230 private:
231 
232  // Restrict allocation to 'StokhosStorageStaticDimension'
233  inline
235  {
236  if ( dimension( unsigned(Rank) ) % ( StokhosStorageStaticDimension ? StokhosStorageStaticDimension : 1 ) ) {
237  std::ostringstream msg ;
238  msg << "Kokkos::View< Sacado::MP::Vector<StorageType , ... > allocation dimension ("
239  << dimension( unsigned(Rank) )
240  << ") must be a multiple of StorageType::static_size ("
241  << StokhosStorageStaticDimension
242  << ")" ;
243  Impl::throw_runtime_exception( msg.str() );
244  }
245  }
246 
247 #if defined( KOKKOS_EXPRESSION_CHECK )
248  KOKKOS_INLINE_FUNCTION
249  void verify_dimension_storage_size( const typename traits::execution_space & dev ) const
250  {
251  const int length = dimension( Rank );
252 
253  const Impl::integral_nonzero_constant< int , StokhosStorageStaticDimension >
254  per_thread( ! StokhosStorageStaticDimension ? length / dev.team_size() : 0 );
255 
256  if ( per_thread.value * dev.team_size() != length ) {
257  Kokkos::abort("Kokkos::View< Sacado::MP::Vector ... > incompatible vector-size : team-size");
258  }
259  }
260 #else
261  KOKKOS_INLINE_FUNCTION
262  void verify_dimension_storage_size( const typename traits::execution_space & ) const {}
263 #endif
264 
265 public:
266 
267  //------------------------------------
268  // Destructor, constructors, assignment operators:
269 
270  KOKKOS_INLINE_FUNCTION
271  ~View() { }
272 
273  KOKKOS_INLINE_FUNCTION
274  View() : m_ptr_on_device(0), m_storage_size(0), m_sacado_size(0)
275  {
276  traits::shape_type::assign(m_shape,0,0,0,0,0,0,0,0);
277  array_shape_type::assign(m_array_shape,0,0,0,0,0,0,0,0);
278  stride_type::assign(m_stride,0);
279  }
280 
281  KOKKOS_INLINE_FUNCTION
282  View( const View & rhs ) : m_ptr_on_device(0), m_storage_size(0), m_sacado_size(0)
283  {
284  (void) Impl::ViewAssignment<
285  typename traits::specialize ,
286  typename traits::specialize >( *this , rhs );
287  }
288 
289  KOKKOS_INLINE_FUNCTION
290  View & operator = ( const View & rhs )
291  {
292  (void) Impl::ViewAssignment<
293  typename traits::specialize ,
294  typename traits::specialize >( *this , rhs );
295  return *this ;
296  }
297 
298  //------------------------------------
299  // Construct or assign compatible view:
300 
301  template< class RT , class RL , class RD , class RM >
302  KOKKOS_INLINE_FUNCTION
303  View( const View<RT,RL,RD,RM,typename traits::specialize> & rhs )
304  : m_ptr_on_device(0)
305  {
306  (void) Impl::ViewAssignment<
307  typename traits::specialize ,
308  typename traits::specialize >( *this , rhs );
309  }
310 
311  template< class RT , class RL , class RD , class RM >
312  KOKKOS_INLINE_FUNCTION
313  View & operator = ( const View<RT,RL,RD,RM,typename traits::specialize> & rhs )
314  {
315  (void) Impl::ViewAssignment<
316  typename traits::specialize ,
317  typename traits::specialize >( *this , rhs );
318  return *this ;
319  }
320 
321  //------------------------------------
322  // Allocation of a managed view with possible alignment padding.
323 
324  template< class AllocationProperties >
325  explicit inline
326  View( const AllocationProperties & prop ,
327  // Impl::ViewAllocProp::size_type exists when the traits and allocation properties
328  // are valid for allocating viewed memory.
329  const typename Impl::ViewAllocProp< traits , AllocationProperties >::size_type n0 = 0 ,
330  const size_t n1 = 0 ,
331  const size_t n2 = 0 ,
332  const size_t n3 = 0 ,
333  const size_t n4 = 0 ,
334  const size_t n5 = 0 ,
335  const size_t n6 = 0 ,
336  const size_t n7 = 0 )
337  : m_ptr_on_device(0)
338  {
339  typedef Impl::ViewAllocProp< traits , AllocationProperties > Alloc ;
340 
341  typedef typename traits::memory_space memory_space ;
342  typedef typename traits::shape_type shape_type ;
344 
345  shape_type::assign( m_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
346  array_shape_type::assign( m_array_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
347  stride_type::assign_with_padding( m_stride , m_array_shape );
348  m_storage_size = Impl::dimension( m_array_shape , unsigned(Rank) );
349  m_sacado_size = m_storage_size;
350 
351  verify_dimension_storage_static_size();
352 
353  m_tracker = memory_space::allocate_and_track( Alloc::label( prop ) , sizeof(scalar_type) * Impl::capacity( m_array_shape , m_stride ) );
354 
355  m_ptr_on_device = (scalar_type *) m_tracker.alloc_ptr();
356 
357  (void) Kokkos::Impl::ViewDefaultConstruct< typename traits::execution_space , scalar_type , Alloc::Initialize >
358  ( m_ptr_on_device , Impl::capacity( m_array_shape , m_stride ) );
359  }
360 
361  //------------------------------------
362  // Assign an unmanaged View from pointer, can be called in functors.
363  // No alignment padding is performed.
364 
365  template< typename T >
366  View( T * ptr ,
367  const size_t n0 = 0 ,
368  const size_t n1 = 0 ,
369  const size_t n2 = 0 ,
370  const size_t n3 = 0 ,
371  const size_t n4 = 0 ,
372  const size_t n5 = 0 ,
373  const size_t n6 = 0 ,
374  typename Impl::enable_if<(
375  ( Impl::is_same<T,typename traits::value_type>::value ||
376  Impl::is_same<T,typename traits::const_value_type>::value ) &&
377  ! traits::is_managed ),
378  const size_t >::type n7 = 0 )
379  : m_ptr_on_device(ptr)
380  {
381  typedef typename traits::shape_type shape_type ;
382 
383  shape_type::assign( m_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
384  array_shape_type::assign( m_array_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
385  stride_type::assign_no_padding( m_stride , m_shape );
386  m_storage_size = Impl::dimension( m_array_shape , unsigned(Rank) );
387  m_sacado_size = m_storage_size;
388  m_management.set_unmanaged();
389 
390  verify_dimension_storage_static_size();
391  }
392 
393  //------------------------------------
394  // Is not allocated
395 
396  KOKKOS_FORCEINLINE_FUNCTION
397  bool is_null() const { return 0 == m_ptr_on_device ; }
398 
399  //------------------------------------
400  //------------------------------------
401  // Scalar operator on traits::rank == 1
402 
403  typedef std::conditional< ( traits::rank == 1 ),
404  reference_type ,
405  Impl::ViewError::scalar_operator_called_from_non_scalar_view >
407 
408  KOKKOS_FORCEINLINE_FUNCTION
409  typename if_scalar_operator::type
410  operator()() const
411  {
412  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
413 
415  m_ptr_on_device ,
416  m_shape.N0 , 1 ) );
417  }
418 
419  //------------------------------------
420  //------------------------------------
421  // Array operators, traits::rank 2:
422 
423  template< typename iType0 >
424  KOKKOS_FORCEINLINE_FUNCTION
425  typename Impl::ViewEnableArrayOper< reference_type , traits, LayoutLeft, 2, iType0 >::type
426  operator() ( const iType0 & i0 ) const
427  {
428  KOKKOS_ASSERT_SHAPE_BOUNDS_2( m_shape, i0, 0 );
429  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
430 
431  // Strided storage
433  m_ptr_on_device + i0 ,
434  m_shape.N1 ,
435  m_stride.value ) );
436  }
437 
438  template< typename iType0 >
439  KOKKOS_FORCEINLINE_FUNCTION
440  typename Impl::ViewEnableArrayOper< reference_type ,
441  traits, LayoutRight, 2, iType0 >::type
442  operator() ( const iType0 & i0 ) const
443  {
444  KOKKOS_ASSERT_SHAPE_BOUNDS_2( m_shape, i0, 0 );
445  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
446 
447  // Contiguous storage with right-most index as the stokhos dimension
449  m_ptr_on_device + ( m_stride.value * i0 ) ,
450  m_shape.N1 , 1 ) );
451  }
452 
453  template< typename iType0 >
454  KOKKOS_FORCEINLINE_FUNCTION
455  typename Impl::ViewEnableArrayOper< reference_type , traits, typename traits::array_layout, 2, iType0 >::type
456  operator[] ( const iType0 & i0 ) const
457  { return operator()( i0 ); }
458 
459  template< typename iType0 >
460  KOKKOS_FORCEINLINE_FUNCTION
461  typename Impl::ViewEnableArrayOper< reference_type ,
462  traits, typename traits::array_layout, 2,
463  iType0 >::type
464  at( const iType0 & i0 , int , int , int , int , int , int , int ) const
465  { return operator()(i0); }
466 
467  //------------------------------------
468  //------------------------------------
469  // Array operators, traits::rank 3:
470 
471  template< typename iType0 , typename iType1 >
472  KOKKOS_FORCEINLINE_FUNCTION
473  typename Impl::ViewEnableArrayOper< reference_type ,
474  traits, LayoutLeft, 3, iType0, iType1 >::type
475  operator() ( const iType0 & i0 , const iType1 & i1 ) const
476  {
477  KOKKOS_ASSERT_SHAPE_BOUNDS_3( m_shape, i0, i1, 0 );
478  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
479 
480  // Strided storage with right-most index as the stokhos dimension
482  m_ptr_on_device + ( i0 + m_stride.value * ( i1 )),
483  m_shape.N2 ,
484  m_stride.value * m_shape.N1 ) );
485  }
486 
487  template< typename iType0 , typename iType1 >
488  KOKKOS_FORCEINLINE_FUNCTION
489  typename Impl::ViewEnableArrayOper< reference_type ,
490  traits, LayoutRight, 3, iType0, iType1 >::type
491  operator() ( const iType0 & i0 , const iType1 & i1 ) const
492  {
493  KOKKOS_ASSERT_SHAPE_BOUNDS_3( m_shape, i0, i1, 0);
494  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
495 
496  // Contiguous storage with right-most index as the stokhos dimension
498  m_ptr_on_device + ( m_storage_size * ( i1 ) + m_stride.value * i0 ) ,
499  m_shape.N2 , 1 ) );
500  }
501 
502  template< typename iType0 , typename iType1 >
503  KOKKOS_FORCEINLINE_FUNCTION
504  typename Impl::ViewEnableArrayOper< reference_type ,
505  traits, typename traits::array_layout, 3,
506  iType0, iType1 >::type
507  at( const iType0 & i0 , const iType1 & i1 , int , int , int , int , int , int ) const
508  { return operator()(i0,i1); }
509 
510  //------------------------------------
511  //------------------------------------
512  // Array operators, traits::rank 4:
513 
514  template< typename iType0 , typename iType1 , typename iType2 >
515  KOKKOS_FORCEINLINE_FUNCTION
516  typename Impl::ViewEnableArrayOper< reference_type ,
517  traits, LayoutLeft, 4, iType0, iType1, iType2 >::type
518  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 ) const
519  {
520  KOKKOS_ASSERT_SHAPE_BOUNDS_4( m_shape, i0, i1, i2, 0 );
521  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
522 
523  // Strided storage with right-most index as the stokhos dimension
525  m_ptr_on_device + ( i0 + m_stride.value * (
526  i1 + m_shape.N1 * (
527  i2 ))),
528  m_shape.N3 ,
529  m_stride.value * m_shape.N1 * m_shape.N2 ) );
530  }
531 
532  template< typename iType0 , typename iType1 , typename iType2 >
533  KOKKOS_FORCEINLINE_FUNCTION
534  typename Impl::ViewEnableArrayOper< reference_type ,
535  traits, LayoutRight, 4, iType0, iType1, iType2 >::type
536  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 ) const
537  {
538  KOKKOS_ASSERT_SHAPE_BOUNDS_4( m_shape, i0, i1, i2, 0 );
539  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
540 
541  // Contiguous storage with right-most index as the stokhos dimension
543  m_ptr_on_device + ( m_storage_size * ( i2 +
544  m_shape.N2 * ( i1 )) +
545  m_stride.value * i0 ) ,
546  m_shape.N3 , 1 ) );
547  }
548 
549  template< typename iType0 , typename iType1 , typename iType2 >
550  KOKKOS_FORCEINLINE_FUNCTION
551  typename Impl::ViewEnableArrayOper< reference_type ,
552  traits, typename traits::array_layout, 4,
553  iType0, iType1, iType2 >::type
554  at( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , int , int , int , int , int ) const
555  { return operator()(i0,i1,i2); }
556 
557  //------------------------------------
558  //------------------------------------
559  // Array operators, traits::rank 5:
560 
561  template< typename iType0 , typename iType1 , typename iType2 , typename iType3 >
562  KOKKOS_FORCEINLINE_FUNCTION
563  typename Impl::ViewEnableArrayOper< reference_type ,
564  traits, LayoutLeft, 5, iType0, iType1, iType2, iType3 >::type
565  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ) const
566  {
567  KOKKOS_ASSERT_SHAPE_BOUNDS_5( m_shape, i0, i1, i2, i3, 0 );
568  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
569 
570  // Strided storage with right-most index as the stokhos dimension
572  m_ptr_on_device + ( i0 + m_stride.value * (
573  i1 + m_shape.N1 * (
574  i2 + m_shape.N2 * (
575  i3 )))),
576  m_shape.N4 ,
577  m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 ) );
578  }
579 
580  template< typename iType0 , typename iType1 , typename iType2 , typename iType3 >
581  KOKKOS_FORCEINLINE_FUNCTION
582  typename Impl::ViewEnableArrayOper< reference_type ,
583  traits, LayoutRight, 5, iType0, iType1, iType2, iType3 >::type
584  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ) const
585  {
586  KOKKOS_ASSERT_SHAPE_BOUNDS_5( m_shape, i0, i1, i2, i3, 0 );
587  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
588 
589  // Contiguous storage with right-most index as the stokhos dimension
591  m_ptr_on_device + ( m_storage_size * ( i3 +
592  m_shape.N3 * ( i2 +
593  m_shape.N2 * ( i1 ))) +
594  m_stride.value * i0 ) ,
595  m_shape.N4 , 1 ) );
596  }
597 
598  template< typename iType0 , typename iType1 , typename iType2 , typename iType3 >
599  KOKKOS_FORCEINLINE_FUNCTION
600  typename Impl::ViewEnableArrayOper< reference_type ,
601  traits, typename traits::array_layout, 5,
602  iType0, iType1, iType2, iType3 >::type
603  at( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , int , int , int , int ) const
604  { return operator()(i0,i1,i2,i3); }
605 
606  //------------------------------------
607  //------------------------------------
608  // Array operators, traits::rank 6:
609 
610  template< typename iType0 , typename iType1 , typename iType2 , typename iType3 , typename iType4 >
611  KOKKOS_FORCEINLINE_FUNCTION
612  typename Impl::ViewEnableArrayOper< reference_type ,
613  traits, LayoutLeft, 6, iType0, iType1, iType2, iType3, iType4 >::type
614  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 , const iType4 & i4 ) const
615  {
616  KOKKOS_ASSERT_SHAPE_BOUNDS_6( m_shape, i0, i1, i2, i3, i4, 0 );
617  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
618 
619  // Strided storage with right-most index as the stokhos dimension
621  m_ptr_on_device + ( i0 + m_stride.value * (
622  i1 + m_shape.N1 * (
623  i2 + m_shape.N2 * (
624  i3 + m_shape.N3 * (
625  i4 ))))),
626  m_shape.N5 ,
627  m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 * m_shape.N4 ) );
628  }
629 
630  template< typename iType0 , typename iType1 , typename iType2 ,
631  typename iType3 , typename iType4 >
632  KOKKOS_FORCEINLINE_FUNCTION
633  typename Impl::ViewEnableArrayOper< reference_type ,
634  traits, LayoutRight, 6, iType0, iType1, iType2, iType3, iType4 >::type
635  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ,
636  const iType4 & i4 ) const
637  {
638  KOKKOS_ASSERT_SHAPE_BOUNDS_6( m_shape, i0, i1, i2, i3, i4, 0 );
639  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
640 
641  // Contiguous storage with right-most index as the stokhos dimension
643  m_ptr_on_device + ( m_storage_size * ( i4 +
644  m_shape.N4 * ( i3 +
645  m_shape.N3 * ( i2 +
646  m_shape.N2 * ( i1 )))) +
647  m_stride.value * i0 ) ,
648  m_shape.N5 , 1 ) );
649  }
650 
651  template< typename iType0 , typename iType1 , typename iType2 ,
652  typename iType3 , typename iType4 >
653  KOKKOS_FORCEINLINE_FUNCTION
654  typename Impl::ViewEnableArrayOper< reference_type ,
655  traits, typename traits::array_layout, 6,
656  iType0, iType1, iType2, iType3, iType4 >::type
657  at( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ,
658  const iType4 & i4 , int , int , int ) const
659  { return operator()(i0,i1,i2,i3,i4); }
660 
661  //------------------------------------
662  //------------------------------------
663  // Array operators, traits::rank 7:
664 
665  template< typename iType0 , typename iType1 , typename iType2 , typename iType3 , typename iType4 , typename iType5 >
666  KOKKOS_FORCEINLINE_FUNCTION
667  typename Impl::ViewEnableArrayOper< reference_type ,
668  traits, LayoutLeft, 7, iType0, iType1, iType2, iType3, iType4, iType5 >::type
669  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 ,
670  const iType3 & i3 , const iType4 & i4 , const iType5 & i5 ) const
671  {
672  KOKKOS_ASSERT_SHAPE_BOUNDS_7( m_shape, i0, i1, i2, i3, i4, i5, 0 );
673  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
674 
675  // Strided storage with right-most index as the stokhos dimension
677  m_ptr_on_device + ( i0 + m_stride.value * (
678  i1 + m_shape.N1 * (
679  i2 + m_shape.N2 * (
680  i3 + m_shape.N3 * (
681  i4 + m_shape.N4 * (
682  i5 )))))),
683  m_shape.N6 ,
684  m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 * m_shape.N4 * m_shape.N5 ) );
685  }
686 
687  template< typename iType0 , typename iType1 , typename iType2 ,
688  typename iType3 , typename iType4 , typename iType5 >
689  KOKKOS_FORCEINLINE_FUNCTION
690  typename Impl::ViewEnableArrayOper< reference_type ,
691  traits, LayoutRight, 7, iType0, iType1, iType2, iType3, iType4, iType5 >::type
692  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ,
693  const iType4 & i4 , const iType5 & i5 ) const
694  {
695  KOKKOS_ASSERT_SHAPE_BOUNDS_7( m_shape, i0, i1, i2, i3, i4, i5, 0 );
696  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
697 
698  // Contiguous storage with right-most index as the stokhos dimension
700  m_ptr_on_device + ( m_storage_size * ( i5 +
701  m_shape.N5 * ( i4 +
702  m_shape.N4 * ( i3 +
703  m_shape.N3 * ( i2 +
704  m_shape.N2 * ( i1 ))))) +
705  m_stride.value * i0 ) ,
706  m_shape.N6 , 1 ) );
707  }
708 
709  template< typename iType0 , typename iType1 , typename iType2 ,
710  typename iType3 , typename iType4 , typename iType5 >
711  KOKKOS_FORCEINLINE_FUNCTION
712  typename Impl::ViewEnableArrayOper< reference_type ,
713  traits, typename traits::array_layout, 7,
714  iType0, iType1, iType2, iType3, iType4, iType5 >::type
715  at( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ,
716  const iType4 & i4 , const iType5 & i5 , int , int ) const
717  { return operator()(i0,i1,i2,i3,i4,i5); }
718 
719  //------------------------------------
720  //------------------------------------
721  // Array operators, traits::rank 8:
722 
723  template< typename iType0 , typename iType1 , typename iType2 , typename iType3 ,
724  typename iType4 , typename iType5 , typename iType6 >
725  KOKKOS_FORCEINLINE_FUNCTION
726  typename Impl::ViewEnableArrayOper< reference_type ,
727  traits, LayoutLeft, 8, iType0, iType1, iType2, iType3, iType4, iType5, iType6 >::type
728  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ,
729  const iType4 & i4 , const iType5 & i5 , const iType6 & i6 ) const
730  {
731  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
732  KOKKOS_ASSERT_SHAPE_BOUNDS_8( m_shape, i0, i1, i2, i3, i4, i5, i6, 0 );
733 
734  // Strided storage with right-most index as the stokhos dimension
736  m_ptr_on_device + ( i0 + m_stride.value * (
737  i1 + m_shape.N1 * (
738  i2 + m_shape.N2 * (
739  i3 + m_shape.N3 * (
740  i4 + m_shape.N4 * (
741  i5 + m_shape.N5 * (
742  i6 ))))))),
743  m_shape.N7 ,
744  m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 * m_shape.N4 * m_shape.N5 * m_shape.N6 ) );
745  }
746 
747  template< typename iType0 , typename iType1 , typename iType2 ,
748  typename iType3 , typename iType4 , typename iType5, typename iType6 >
749  KOKKOS_FORCEINLINE_FUNCTION
750  typename Impl::ViewEnableArrayOper< reference_type ,
751  traits, LayoutRight, 8, iType0, iType1, iType2, iType3, iType4, iType5, iType6 >::type
752  operator() ( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ,
753  const iType4 & i4 , const iType5 & i5 , const iType6 & i6 ) const
754  {
755  KOKKOS_ASSERT_SHAPE_BOUNDS_8( m_shape, i0, i1, i2, i3, i4, i5, i6, 0 );
756  KOKKOS_RESTRICT_EXECUTION_TO_DATA( typename traits::memory_space , m_ptr_on_device );
757 
758  // Contiguous storage with right-most index as the stokhos dimension
760  m_ptr_on_device + ( m_storage_size * ( i6 +
761  m_shape.N6 * ( i5 +
762  m_shape.N5 * ( i4 +
763  m_shape.N4 * ( i3 +
764  m_shape.N3 * ( i2 +
765  m_shape.N2 * ( i1 )))))) +
766  m_stride.value * i0 ) ,
767  m_shape.N7 , 1 ) );
768  }
769 
770  template< typename iType0 , typename iType1 , typename iType2 ,
771  typename iType3 , typename iType4 , typename iType5, typename iType6 >
772  KOKKOS_FORCEINLINE_FUNCTION
773  typename Impl::ViewEnableArrayOper< reference_type ,
774  traits, typename traits::array_layout, 8,
775  iType0, iType1, iType2, iType3, iType4, iType5, iType6 >::type
776  at( const iType0 & i0 , const iType1 & i1 , const iType2 & i2 , const iType3 & i3 ,
777  const iType4 & i4 , const iType5 & i5 , const iType6 & i6 , int ) const
778  { return operator()(i0,i1,i2,i3,i4,i5,i6); }
779 
780  //------------------------------------
781  // Access to the underlying contiguous storage of this view specialization.
782  // These methods are specific to specialization of a view.
783 
784  KOKKOS_FORCEINLINE_FUNCTION
786  data() const { return m_ptr_on_device ; }
787 
788  // Stride of physical storage, dimensioned to at least Rank
789  template< typename iType >
790  KOKKOS_FORCEINLINE_FUNCTION
791  void stride( iType * const s ) const
792  { Impl::stride( s , m_array_shape , m_stride ); }
793 
794  // Count of contiguously allocated data members including padding.
795  KOKKOS_FORCEINLINE_FUNCTION
796  typename traits::size_type capacity() const
797  { return Impl::capacity( m_array_shape , m_stride ); }
798 
799  // Static storage size
800  KOKKOS_FORCEINLINE_FUNCTION
801  typename traits::size_type sacado_size() const
802  { return m_sacado_size.value; }
803 };
804 
808 template< class DT , class DL , class DD , class DM ,
809  class ST , class SL , class SD , class SM >
810 inline
811 void deep_copy( const View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced> & dst ,
812  const View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced> & src ,
813  typename Impl::enable_if<(
814  Impl::is_same< typename View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced>::intinsic_scalar_type ,
815  typename View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced>::intinsic_scalar_type >::value
816  &&
817  Impl::is_same< typename View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced>::array_layout ,
818  typename View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced>::array_layout >::value
819  &&
820  ( unsigned(View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced>::rank) ==
821  unsigned(View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced>::rank) )
822  )>::type * = 0 )
823 {
824  typedef View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced> dst_type ;
825  typedef View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced> src_type ;
826 
827  typedef typename dst_type::memory_space dst_memory_space ;
828  typedef typename src_type::memory_space src_memory_space ;
829 
830  if ( dst.data() != src.data() ) {
831 
832  Impl::assert_shapes_are_equal( dst.shape() , src.shape() );
833 
834  const size_t nbytes = sizeof(typename dst_type::value_type::storage_type::value_type) * dst.span();
835 
836  Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , nbytes );
837  }
838 }
839 
840 } // namespace Kokkos
841 
842 //----------------------------------------------------------------------------
843 //----------------------------------------------------------------------------
844 
845 namespace Kokkos {
846 namespace Impl {
847 
854 template< class StorageType >
855 struct AnalyzeShape< Sacado::MP::Vector< StorageType > >
856  : Shape< sizeof(Sacado::MP::Vector< StorageType >) , 0 > // Treat as a scalar
857 {
858 private:
859 
860  typedef AnalyzeShape< typename StorageType::value_type > nested ;
861 
862 public:
863 
865 
866  typedef Shape< sizeof(Sacado::MP::Vector< StorageType >) , 0 > shape ;
867 
868  // If ( ! StorageType::is_static ) then 0 == StorageType::static_size and the first array declaration is not used.
869  // However, the compiler will still generate this type declaration and it must not have a zero length.
870  typedef typename
871  std::conditional< StorageType::is_static
872  , typename nested::array_intrinsic_type [ StorageType::is_static ? StorageType::static_size : 1 ]
873  , typename nested::array_intrinsic_type *
875 
876  typedef typename
877  std::conditional< StorageType::is_static
878  , typename nested::const_array_intrinsic_type [ StorageType::is_static ? StorageType::static_size : 1 ]
879  , typename nested::const_array_intrinsic_type *
881 
883 
887 
891 };
892 
893 //----------------------------------------------------------------------------
894 
895 template<>
896 struct ViewAssignment< ViewMPVectorInterlaced , ViewMPVectorInterlaced , void >
897 {
898  typedef ViewMPVectorContiguous specialize ;
899 
900  //------------------------------------
903  template< class DT , class DL , class DD , class DM ,
904  class ST , class SL , class SD , class SM >
905  KOKKOS_INLINE_FUNCTION
906  ViewAssignment( View<DT,DL,DD,DM,specialize> & dst
907  , const View<ST,SL,SD,SM,specialize> & src
908  , const typename enable_if<(
909  ViewAssignable< ViewTraits<DT,DL,DD,DM> ,
910  ViewTraits<ST,SL,SD,SM> >::value
911  )>::type * = 0
912  )
913  {
914  typedef ViewTraits<DT,DL,DD,DM> dst_traits ;
915  typedef View<DT,DL,DD,DM,specialize> dst_type ;
916  typedef typename dst_type::shape_type shape_type ;
917  typedef typename dst_type::array_shape_type array_shape_type ;
918  typedef typename dst_type::stride_type stride_type ;
919 
920  shape_type::assign( dst.m_shape,
921  src.m_shape.N0 , src.m_shape.N1 , src.m_shape.N2 , src.m_shape.N3 ,
922  src.m_shape.N4 , src.m_shape.N5 , src.m_shape.N6 , src.m_shape.N7 );
923  array_shape_type::assign( dst.m_array_shape,
924  src.m_array_shape.N0 , src.m_array_shape.N1 , src.m_array_shape.N2 , src.m_array_shape.N3 ,
925  src.m_array_shape.N4 , src.m_array_shape.N5 , src.m_array_shape.N6 , src.m_array_shape.N7 );
926 
927  stride_type::assign( dst.m_stride , src.m_stride.value );
928  dst.m_ptr_on_device = src.m_ptr_on_device ;
929  dst.m_storage_size = src.m_storage_size ;
930  dst.m_sacado_size = src.m_sacado_size ;
931  dst.m_tracker = src.m_tracker ;
932  }
933 
934  //------------------------------------
937  template< class DT , class DL , class DD , class DM ,
938  class ST , class SL , class SD , class SM >
939  KOKKOS_INLINE_FUNCTION
940  ViewAssignment( View<DT,DL,DD,DM,specialize> & dst
941  , const View<ST,SL,SD,SM,specialize> & src
942  , typename enable_if<(
943  // Same intrinsic scalar type
944  is_same< typename View<DT,DL,DD,DM,specialize>::intrinsic_scalar_type ,
945  typename View<ST,SL,SD,SM,specialize>::intrinsic_scalar_type >::value
946  &&
947  // Same memory space
948  is_same< typename View<DT,DL,DD,DM,specialize>::memory_space ,
949  typename View<ST,SL,SD,SM,specialize>::memory_space >::value
950  &&
951  // Same layout
952  is_same< typename View<DT,DL,DD,DM,specialize>::array_layout ,
953  typename View<ST,SL,SD,SM,specialize>::array_layout >::value
954  &&
955  // Same rank
956  ( unsigned(View<DT,DL,DD,DM,specialize>::rank) ==
957  unsigned(View<ST,SL,SD,SM,specialize>::rank) )
958  &&
959  // Destination is not managed
960  ! View<DT,DL,DD,DM,specialize>::is_managed
961  ), const Sacado::MP::VectorPartition & >::type part )
962  {
963  typedef ViewTraits<DT,DL,DD,DM> dst_traits ;
964  typedef View<DT,DL,DD,DM,specialize> dst_type ;
965  typedef typename dst_type::shape_type dst_shape_type ;
966  typedef typename dst_type::array_shape_type dst_array_shape_type ;
967  typedef typename dst_type::stride_type dst_stride_type ;
968  typedef typename dst_traits::value_type dst_sacado_mp_vector_type ;
969  typedef typename dst_sacado_mp_vector_type::storage_type dst_stokhos_storage_type ;
970 
971  enum { DstRank = dst_type::rank };
972  enum { DstStaticLength = dst_stokhos_storage_type::static_size };
973 
974  const int length = part.end - part.begin ;
975 
976  if ( DstStaticLength && DstStaticLength != length ) {
977  Kokkos::abort("Kokkos::View< Sacado::MP::Vector ... > incompatible partitioning");
978  }
979 
980  unsigned dims[8];
981  dims[0] = src.m_array_shape.N0;
982  dims[1] = src.m_array_shape.N1;
983  dims[2] = src.m_array_shape.N2;
984  dims[3] = src.m_array_shape.N3;
985  dims[4] = src.m_array_shape.N4;
986  dims[5] = src.m_array_shape.N5;
987  dims[6] = src.m_array_shape.N6;
988  dims[7] = src.m_array_shape.N7;
989  unsigned rank = dst_type::rank;
990 
991  dst_shape_type::assign( dst.m_shape,
992  dims[0] , dims[1] , dims[2] , dims[3] ,
993  dims[4] , dims[5] , dims[6] , dims[7] );
994 
995  dims[rank] = length;
996  dst_array_shape_type::assign( dst.m_array_shape,
997  dims[0] , dims[1] , dims[2] , dims[3] ,
998  dims[4] , dims[5] , dims[6] , dims[7] );
999 
1000  dst_stride_type::assign( dst.m_stride , src.m_stride.value );
1001 
1002  // Original Sacado::MP::Vector length
1003  dst.m_storage_size = src.m_storage_size ;
1004  dst.m_sacado_size = length;
1005 
1006  if ( Impl::is_same< typename dst_traits::array_layout , LayoutLeft >::value ) {
1007  dst.m_ptr_on_device = src.m_ptr_on_device + part.begin *
1008  ( 0 == DstRank ? 1 : dst.m_stride.value * (
1009  ( 1 == DstRank ? 1 : dst.m_shape.N1 * (
1010  ( 2 == DstRank ? 1 : dst.m_shape.N2 * (
1011  ( 3 == DstRank ? 1 : dst.m_shape.N3 * (
1012  ( 4 == DstRank ? 1 : dst.m_shape.N4 * (
1013  ( 5 == DstRank ? 1 : dst.m_shape.N5 * (
1014  ( 6 == DstRank ? 1 : dst.m_shape.N6 )))))))))))));
1015  }
1016  else { // if ( Impl::is_same< typename traits::array_layout , LayoutRight >::value )
1017  dst.m_ptr_on_device = src.m_ptr_on_device + part.begin ;
1018  }
1019  dst.m_tracker = src.m_tracker ;
1020  }
1021 };
1022 
1023 template<>
1024 struct ViewAssignment< ViewDefault , ViewMPVectorInterlaced , void >
1025 {
1026  //------------------------------------
1029  template< class ST , class SL , class SD , class SM >
1030  KOKKOS_INLINE_FUNCTION
1031  ViewAssignment( typename View<ST,SL,SD,SM,ViewMPVectorInterlaced>::array_type & dst
1032  , const View<ST,SL,SD,SM,ViewMPVectorInterlaced> & src )
1033  {
1034  typedef View<ST,SL,SD,SM,ViewMPVectorInterlaced> src_type ;
1035  typedef typename src_type::value_type src_sacado_mp_vector_type ;
1036  typedef typename src_sacado_mp_vector_type::storage_type src_stokhos_storage_type ;
1037 
1038  typedef typename src_type::array_type dst_type ;
1039  typedef typename dst_type::shape_type dst_shape_type ;
1040  typedef typename dst_type::stride_type dst_stride_type ;
1041 
1042  dst_shape_type::assign( dst.m_shape,
1043  src.m_array_shape.N0 , src.m_array_shape.N1 , src.m_array_shape.N2 , src.m_arrat_shape.N3 ,
1044  src.m_array_shape.N4 , src.m_array_shape.N5 , src.m_arrat_shape.N6 , src.m_arrat_shape.N7 );
1045 
1046  dst_stride_type::assign( dst.m_stride , src.m_stride.value );
1047 
1048  dst.m_ptr_on_device = reinterpret_cast< typename dst_type::value_type *>( src.m_ptr_on_device );
1049 
1050  dst.m_tracker = src.m_tracker ;
1051  }
1052 };
1053 
1054 //----------------------------------------------------------------------------
1055 //----------------------------------------------------------------------------
1056 
1057 } // namespace Impl
1058 
1059 } // namespace Kokkos
1060 
1061 //----------------------------------------------------------------------------
1062 //----------------------------------------------------------------------------
1063 
1064 #endif /* #ifndef KOKKOS_VIEW_MP_VECTOR_HPP */
KOKKOS_FORCEINLINE_FUNCTION Impl::ViewEnableArrayOper< reference_type, traits, typename traits::array_layout, 3, iType0, iType1 >::type at(const iType0 &i0, const iType1 &i1, int, int, int, int, int, int) const
View< typename traits::const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::memory_traits > const_type
Stokhos::StandardStorage< int, double > storage_type
Impl::LayoutStride< typename traits::shape_type, typename traits::array_layout > stride_type
Dynamic storage with view semantics and contiguous access.
KOKKOS_INLINE_FUNCTION View(const View< RT, RL, RD, RM, typename traits::specialize > &rhs)
KOKKOS_INLINE_FUNCTION ViewAssignment(typename View< ST, SL, SD, SM, ViewMPVectorInterlaced >::array_type &dst, const View< ST, SL, SD, SM, ViewMPVectorInterlaced > &src)
Compatible value and shape.
View< typename traits::array_type, typename traits::array_layout, typename traits::device_type, typename traits::memory_traits > array_type
Kokkos::DefaultExecutionSpace execution_space
ViewTraits< DataType, typename ViewTraits< DataType, Arg1Type, Arg2Type, Arg3Type >::array_layout, typename ViewTraits< DataType, Arg1Type, Arg2Type, Arg3Type >::device_type, typename ViewTraits< DataType, Arg1Type, Arg2Type, Arg3Type >::memory_traits > traits
View< typename traits::const_array_type, typename traits::array_layout, typename traits::host_mirror_space, typename traits::memory_traits > host_const_array_type
KOKKOS_INLINE_FUNCTION ViewAssignment(View< DT, DL, DD, DM, specialize > &dst, const View< ST, SL, SD, SM, specialize > &src, typename enable_if<(is_same< typename View< DT, DL, DD, DM, specialize >::intrinsic_scalar_type, typename View< ST, SL, SD, SM, specialize >::intrinsic_scalar_type >::value &&is_same< typename View< DT, DL, DD, DM, specialize >::memory_space, typename View< ST, SL, SD, SM, specialize >::memory_space >::value &&is_same< typename View< DT, DL, DD, DM, specialize >::array_layout, typename View< ST, SL, SD, SM, specialize >::array_layout >::value &&(unsigned(View< DT, DL, DD, DM, specialize >::rank)==unsigned(View< ST, SL, SD, SM, specialize >::rank))&&!View< DT, DL, DD, DM, specialize >::is_managed), const Sacado::MP::VectorPartition & >::type part)
Partition of compatible value and shape.
std::conditional< (traits::rank==1), reference_type, Impl::ViewError::scalar_operator_called_from_non_scalar_view > if_scalar_operator
View< typename traits::array_type, typename traits::array_layout, typename traits::host_mirror_space, typename traits::memory_traits > host_array_type
View< typename traits::non_const_data_type, typename traits::array_layout, typename traits::device_type, typename traits::memory_traits > non_const_type
KOKKOS_FORCEINLINE_FUNCTION Impl::ViewEnableArrayOper< reference_type, traits, typename traits::array_layout, 2, iType0 >::type at(const iType0 &i0, int, int, int, int, int, int, int) const
KOKKOS_FORCEINLINE_FUNCTION traits::value_type::storage_type::value_type * data() const
void deep_copy(const Stokhos::CrsMatrix< ValueType, DstDevice, Layout > &dst, const Stokhos::CrsMatrix< ValueType, SrcDevice, Layout > &src)
KOKKOS_FORCEINLINE_FUNCTION Impl::ViewEnableArrayOper< reference_type, traits, typename traits::array_layout, 6, iType0, iType1, iType2, iType3, iType4 >::type at(const iType0 &i0, const iType1 &i1, const iType2 &i2, const iType3 &i3, const iType4 &i4, int, int, int) const
KOKKOS_INLINE_FUNCTION void verify_dimension_storage_size(const typename traits::execution_space &) const
integral_nonzero_constant< unsigned, StokhosStorageStaticDimension > sacado_size_type
View(const AllocationProperties &prop, const typename Impl::ViewAllocProp< traits, AllocationProperties >::size_type n0=0, const size_t n1=0, const size_t n2=0, const size_t n3=0, const size_t n4=0, const size_t n5=0, const size_t n6=0, const size_t n7=0)
KOKKOS_FORCEINLINE_FUNCTION Impl::ViewEnableArrayOper< reference_type, traits, typename traits::array_layout, 4, iType0, iType1, iType2 >::type at(const iType0 &i0, const iType1 &i1, const iType2 &i2, int, int, int, int, int) const
std::conditional< StorageType::is_static, typename nested::array_intrinsic_type[StorageType::is_static?StorageType::static_size:1], typename nested::array_intrinsic_type * >::type array_intrinsic_type
KOKKOS_INLINE_FUNCTION ViewAssignment(View< DT, DL, DD, DM, specialize > &dst, const View< ST, SL, SD, SM, specialize > &src, const typename enable_if<(ViewAssignable< ViewTraits< DT, DL, DD, DM >, ViewTraits< ST, SL, SD, SM > >::value)>::type *=0)
Compatible value and shape.
KOKKOS_FORCEINLINE_FUNCTION Impl::ViewEnableArrayOper< reference_type, traits, typename traits::array_layout, 5, iType0, iType1, iType2, iType3 >::type at(const iType0 &i0, const iType1 &i1, const iType2 &i2, const iType3 &i3, int, int, int, int) const
View< typename Impl::RebindStokhosStorageDevice< typename traits::data_type, typename traits::host_mirror_space::memory_space >::type, typename traits::array_layout, typename traits::host_mirror_space, void > host_mirror_type
View< typename traits::const_array_type, typename traits::array_layout, typename traits::device_type, typename traits::memory_traits > const_array_type
std::conditional< StorageType::is_static, typename nested::const_array_intrinsic_type[StorageType::is_static?StorageType::static_size:1], typename nested::const_array_intrinsic_type * >::type const_array_intrinsic_type
KOKKOS_FORCEINLINE_FUNCTION Impl::ViewEnableArrayOper< reference_type, traits, typename traits::array_layout, 7, iType0, iType1, iType2, iType3, iType4, iType5 >::type at(const iType0 &i0, const iType1 &i1, const iType2 &i2, const iType3 &i3, const iType4 &i4, const iType5 &i5, int, int) const
KOKKOS_FORCEINLINE_FUNCTION traits::size_type dimension(const iType &i) const
View(T *ptr, const size_t n0=0, const size_t n1=0, const size_t n2=0, const size_t n3=0, const size_t n4=0, const size_t n5=0, const size_t n6=0, typename Impl::enable_if<((Impl::is_same< T, typename traits::value_type >::value||Impl::is_same< T, typename traits::const_value_type >::value)&&!traits::is_managed), const size_t >::type n7=0)
KOKKOS_FORCEINLINE_FUNCTION Impl::ViewEnableArrayOper< reference_type, traits, typename traits::array_layout, 8, iType0, iType1, iType2, iType3, iType4, iType5, iType6 >::type at(const iType0 &i0, const iType1 &i1, const iType2 &i2, const iType3 &i3, const iType4 &i4, const iType5 &i5, const iType6 &i6, int) const