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