114class View< DataType , Arg1Type , Arg2Type , Arg3Type , Impl::ViewMPVectorInterlaced >
115 :
public ViewTraits< DataType
116 , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::array_layout
117 , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::device_type
118 , typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::memory_traits
123 typedef ViewTraits< DataType
124 ,
typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::array_layout
125 ,
typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::device_type
126 ,
typename ViewTraits< DataType , Arg1Type, Arg2Type, Arg3Type >::memory_traits
130 typedef View<
typename traits::const_data_type ,
131 typename traits::array_layout ,
132 typename traits::device_type ,
136 typedef View<
typename traits::non_const_data_type ,
137 typename traits::array_layout ,
138 typename traits::device_type ,
143 typename traits::data_type ,
144 typename traits::host_mirror_space::memory_space >::type ,
145 typename traits::array_layout ,
146 typename traits::host_mirror_space ,
150 typedef View<
typename traits::array_type ,
151 typename traits::array_layout ,
152 typename traits::device_type ,
156 typedef View<
typename traits::const_array_type ,
157 typename traits::array_layout ,
158 typename traits::device_type ,
162 typedef View<
typename traits::array_type ,
163 typename traits::array_layout ,
164 typename traits::host_mirror_space ,
168 typedef View<
typename traits::const_array_type ,
169 typename traits::array_layout ,
170 typename traits::host_mirror_space ,
180 template<
class ,
class ,
class ,
class ,
class >
friend class View ;
183 template<
class ,
class ,
class >
friend struct Impl::ViewAssignment ;
185 enum { StokhosStorageStaticDimension = stokhos_storage_type::static_size };
186 typedef integral_nonzero_constant< unsigned , StokhosStorageStaticDimension >
sacado_size_type;
188 typedef Impl::LayoutStride<
typename traits::shape_type ,
204 typename stokhos_storage_type::ordinal_type ,
205 typename stokhos_storage_type::value_type ,
206 StokhosStorageStaticDimension ,
208 ( Impl::is_same< typename traits::array_layout , LayoutRight >::value ? 1 : 0 ) ,
217 static const bool is_static = stokhos_storage_type::is_static;
220 static const bool is_contiguous =
221 Impl::is_same< typename traits::array_layout , LayoutRight >::value;
225 enum { Rank = traits::rank };
228 enum { Sacado_Rank = Rank+1 };
230 KOKKOS_FORCEINLINE_FUNCTION
typename traits::shape_type
shape()
const {
return m_shape ; }
231 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_0()
const {
return m_shape.N0 ; }
232 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_1()
const {
return m_shape.N1 ; }
233 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_2()
const {
return m_shape.N2 ; }
234 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_3()
const {
return m_shape.N3 ; }
235 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_4()
const {
return m_shape.N4 ; }
236 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_5()
const {
return m_shape.N5 ; }
237 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_6()
const {
return m_shape.N6 ; }
238 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
dimension_7()
const {
return m_shape.N7 ; }
239 KOKKOS_FORCEINLINE_FUNCTION
typename traits::size_type
size()
const
252 template<
typename iType >
253 KOKKOS_FORCEINLINE_FUNCTION
254 typename traits::size_type
dimension(
const iType & i )
const
255 {
return Impl::dimension( m_shape , i ); }
265 if ( dimension(
unsigned(Rank) ) % ( StokhosStorageStaticDimension ? StokhosStorageStaticDimension : 1 ) ) {
266 std::ostringstream msg ;
267 msg <<
"Kokkos::View< Sacado::MP::Vector<StorageType , ... > allocation dimension ("
268 << dimension(
unsigned(Rank) )
269 <<
") must be a multiple of StorageType::static_size ("
270 << StokhosStorageStaticDimension
272 Impl::throw_runtime_exception( msg.str() );
276#if defined( KOKKOS_EXPRESSION_CHECK )
277 KOKKOS_INLINE_FUNCTION
278 void verify_dimension_storage_size(
const typename traits::execution_space & dev )
const
280 const int length = dimension( Rank );
282 const Impl::integral_nonzero_constant< int , StokhosStorageStaticDimension >
283 per_thread( ! StokhosStorageStaticDimension ? length / dev.team_size() : 0 );
285 if ( per_thread.value * dev.team_size() != length ) {
286 Kokkos::abort(
"Kokkos::View< Sacado::MP::Vector ... > incompatible vector-size : team-size");
290 KOKKOS_INLINE_FUNCTION
299 KOKKOS_INLINE_FUNCTION
302 KOKKOS_INLINE_FUNCTION
303 View() : m_ptr_on_device(0), m_storage_size(0), m_sacado_size(0)
305 traits::shape_type::assign(m_shape,0,0,0,0,0,0,0,0);
306 array_shape_type::assign(m_array_shape,0,0,0,0,0,0,0,0);
307 stride_type::assign(m_stride,0);
310 KOKKOS_INLINE_FUNCTION
311 View(
const View & rhs ) : m_ptr_on_device(0), m_storage_size(0), m_sacado_size(0)
313 (void) Impl::ViewAssignment<
314 typename traits::specialize ,
315 typename traits::specialize >( *
this , rhs );
318 KOKKOS_INLINE_FUNCTION
319 View & operator = (
const View & rhs )
321 (void) Impl::ViewAssignment<
322 typename traits::specialize ,
323 typename traits::specialize >( *
this , rhs );
330 template<
class RT ,
class RL ,
class RD ,
class RM >
331 KOKKOS_INLINE_FUNCTION
332 View(
const View<RT,RL,RD,RM,typename traits::specialize> & rhs )
335 (void) Impl::ViewAssignment<
336 typename traits::specialize ,
337 typename traits::specialize >( *
this , rhs );
340 template<
class RT ,
class RL ,
class RD ,
class RM >
341 KOKKOS_INLINE_FUNCTION
342 View & operator = (
const View<RT,RL,RD,RM,typename traits::specialize> & rhs )
344 (void) Impl::ViewAssignment<
345 typename traits::specialize ,
346 typename traits::specialize >( *
this , rhs );
353 template<
class AllocationProperties >
355 View(
const AllocationProperties & prop ,
358 const typename Impl::ViewAllocProp< traits , AllocationProperties >::size_type n0 = 0 ,
359 const size_t n1 = 0 ,
360 const size_t n2 = 0 ,
361 const size_t n3 = 0 ,
362 const size_t n4 = 0 ,
363 const size_t n5 = 0 ,
364 const size_t n6 = 0 ,
365 const size_t n7 = 0 )
368 typedef Impl::ViewAllocProp< traits , AllocationProperties > Alloc ;
370 typedef typename traits::memory_space memory_space ;
371 typedef typename traits::shape_type shape_type ;
372 typedef typename stokhos_storage_type::value_type scalar_type ;
374 shape_type::assign( m_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
375 array_shape_type::assign( m_array_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
376 stride_type::assign_with_padding( m_stride , m_array_shape );
377 m_storage_size = Impl::dimension( m_array_shape ,
unsigned(Rank) );
378 m_sacado_size = m_storage_size;
380 verify_dimension_storage_static_size();
382 m_tracker = memory_space::allocate_and_track( Alloc::label( prop ) ,
sizeof(scalar_type) * Impl::capacity( m_array_shape , m_stride ) );
384 m_ptr_on_device = (scalar_type *) m_tracker.alloc_ptr();
386 (void) Kokkos::Impl::ViewDefaultConstruct< typename traits::execution_space , scalar_type , Alloc::Initialize >
387 ( m_ptr_on_device , Impl::capacity( m_array_shape , m_stride ) );
394 template<
typename T >
396 const size_t n0 = 0 ,
397 const size_t n1 = 0 ,
398 const size_t n2 = 0 ,
399 const size_t n3 = 0 ,
400 const size_t n4 = 0 ,
401 const size_t n5 = 0 ,
402 const size_t n6 = 0 ,
403 typename Impl::enable_if<(
404 ( Impl::is_same<T,typename traits::value_type>::value ||
405 Impl::is_same<T,typename traits::const_value_type>::value ) &&
406 ! traits::is_managed ),
407 const size_t >::type n7 = 0 )
408 : m_ptr_on_device(ptr)
410 typedef typename traits::shape_type shape_type ;
412 shape_type::assign( m_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
413 array_shape_type::assign( m_array_shape, n0, n1, n2, n3, n4, n5, n6, n7 );
414 stride_type::assign_no_padding( m_stride , m_shape );
415 m_storage_size = Impl::dimension( m_array_shape ,
unsigned(Rank) );
416 m_sacado_size = m_storage_size;
417 m_management.set_unmanaged();
419 verify_dimension_storage_static_size();
425 KOKKOS_FORCEINLINE_FUNCTION
426 bool is_null()
const {
return 0 == m_ptr_on_device ; }
432 typedef std::conditional< ( traits::rank == 1 ),
434 Impl::ViewError::scalar_operator_called_from_non_scalar_view >
437 KOKKOS_FORCEINLINE_FUNCTION
438 typename if_scalar_operator::type
441 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
452 template<
typename iType0 >
453 KOKKOS_FORCEINLINE_FUNCTION
454 typename Impl::ViewEnableArrayOper< reference_type , traits, LayoutLeft, 2, iType0 >::type
455 operator() (
const iType0 & i0 )
const
457 KOKKOS_ASSERT_SHAPE_BOUNDS_2( m_shape, i0, 0 );
458 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
462 m_ptr_on_device + i0 ,
467 template<
typename iType0 >
468 KOKKOS_FORCEINLINE_FUNCTION
469 typename Impl::ViewEnableArrayOper< reference_type ,
470 traits, LayoutRight, 2, iType0 >::type
471 operator() (
const iType0 & i0 )
const
473 KOKKOS_ASSERT_SHAPE_BOUNDS_2( m_shape, i0, 0 );
474 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
478 m_ptr_on_device + ( m_stride.value * i0 ) ,
482 template<
typename iType0 >
483 KOKKOS_FORCEINLINE_FUNCTION
484 typename Impl::ViewEnableArrayOper< reference_type , traits, typename traits::array_layout, 2, iType0 >::type
485 operator[] (
const iType0 & i0 )
const
486 {
return operator()( i0 ); }
488 template<
typename iType0 >
489 KOKKOS_FORCEINLINE_FUNCTION
490 typename Impl::ViewEnableArrayOper< reference_type ,
491 traits,
typename traits::array_layout, 2,
493 at(
const iType0 & i0 ,
int ,
int ,
int ,
int ,
int ,
int ,
int )
const
494 {
return operator()(i0); }
500 template<
typename iType0 ,
typename iType1 >
501 KOKKOS_FORCEINLINE_FUNCTION
502 typename Impl::ViewEnableArrayOper< reference_type ,
503 traits, LayoutLeft, 3, iType0, iType1 >::type
504 operator() (
const iType0 & i0 ,
const iType1 & i1 )
const
506 KOKKOS_ASSERT_SHAPE_BOUNDS_3( m_shape, i0, i1, 0 );
507 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
511 m_ptr_on_device + ( i0 + m_stride.value * ( i1 )),
513 m_stride.value * m_shape.N1 ) );
516 template<
typename iType0 ,
typename iType1 >
517 KOKKOS_FORCEINLINE_FUNCTION
518 typename Impl::ViewEnableArrayOper< reference_type ,
519 traits, LayoutRight, 3, iType0, iType1 >::type
520 operator() (
const iType0 & i0 ,
const iType1 & i1 )
const
522 KOKKOS_ASSERT_SHAPE_BOUNDS_3( m_shape, i0, i1, 0);
523 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
527 m_ptr_on_device + ( m_storage_size * ( i1 ) + m_stride.value * i0 ) ,
531 template<
typename iType0 ,
typename iType1 >
532 KOKKOS_FORCEINLINE_FUNCTION
533 typename Impl::ViewEnableArrayOper< reference_type ,
534 traits,
typename traits::array_layout, 3,
535 iType0, iType1 >::type
536 at(
const iType0 & i0 ,
const iType1 & i1 ,
int ,
int ,
int ,
int ,
int ,
int )
const
537 {
return operator()(i0,i1); }
543 template<
typename iType0 ,
typename iType1 ,
typename iType2 >
544 KOKKOS_FORCEINLINE_FUNCTION
545 typename Impl::ViewEnableArrayOper< reference_type ,
546 traits, LayoutLeft, 4, iType0, iType1, iType2 >::type
547 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 )
const
549 KOKKOS_ASSERT_SHAPE_BOUNDS_4( m_shape, i0, i1, i2, 0 );
550 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
554 m_ptr_on_device + ( i0 + m_stride.value * (
558 m_stride.value * m_shape.N1 * m_shape.N2 ) );
561 template<
typename iType0 ,
typename iType1 ,
typename iType2 >
562 KOKKOS_FORCEINLINE_FUNCTION
563 typename Impl::ViewEnableArrayOper< reference_type ,
564 traits, LayoutRight, 4, iType0, iType1, iType2 >::type
565 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 )
const
567 KOKKOS_ASSERT_SHAPE_BOUNDS_4( m_shape, i0, i1, i2, 0 );
568 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
572 m_ptr_on_device + ( m_storage_size * ( i2 +
573 m_shape.N2 * ( i1 )) +
574 m_stride.value * i0 ) ,
578 template<
typename iType0 ,
typename iType1 ,
typename iType2 >
579 KOKKOS_FORCEINLINE_FUNCTION
580 typename Impl::ViewEnableArrayOper< reference_type ,
581 traits,
typename traits::array_layout, 4,
582 iType0, iType1, iType2 >::type
583 at(
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
int ,
int ,
int ,
int ,
int )
const
584 {
return operator()(i0,i1,i2); }
590 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
typename iType3 >
591 KOKKOS_FORCEINLINE_FUNCTION
592 typename Impl::ViewEnableArrayOper< reference_type ,
593 traits, LayoutLeft, 5, iType0, iType1, iType2, iType3 >::type
594 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 )
const
596 KOKKOS_ASSERT_SHAPE_BOUNDS_5( m_shape, i0, i1, i2, i3, 0 );
597 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
601 m_ptr_on_device + ( i0 + m_stride.value * (
606 m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 ) );
609 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
typename iType3 >
610 KOKKOS_FORCEINLINE_FUNCTION
611 typename Impl::ViewEnableArrayOper< reference_type ,
612 traits, LayoutRight, 5, iType0, iType1, iType2, iType3 >::type
613 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 )
const
615 KOKKOS_ASSERT_SHAPE_BOUNDS_5( m_shape, i0, i1, i2, i3, 0 );
616 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
620 m_ptr_on_device + ( m_storage_size * ( i3 +
622 m_shape.N2 * ( i1 ))) +
623 m_stride.value * i0 ) ,
627 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
typename iType3 >
628 KOKKOS_FORCEINLINE_FUNCTION
629 typename Impl::ViewEnableArrayOper< reference_type ,
630 traits,
typename traits::array_layout, 5,
631 iType0, iType1, iType2, iType3 >::type
632 at(
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
int ,
int ,
int ,
int )
const
633 {
return operator()(i0,i1,i2,i3); }
639 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
typename iType3 ,
typename iType4 >
640 KOKKOS_FORCEINLINE_FUNCTION
641 typename Impl::ViewEnableArrayOper< reference_type ,
642 traits, LayoutLeft, 6, iType0, iType1, iType2, iType3, iType4 >::type
643 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
const iType4 & i4 )
const
645 KOKKOS_ASSERT_SHAPE_BOUNDS_6( m_shape, i0, i1, i2, i3, i4, 0 );
646 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
650 m_ptr_on_device + ( i0 + m_stride.value * (
656 m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 * m_shape.N4 ) );
659 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
660 typename iType3 ,
typename iType4 >
661 KOKKOS_FORCEINLINE_FUNCTION
662 typename Impl::ViewEnableArrayOper< reference_type ,
663 traits, LayoutRight, 6, iType0, iType1, iType2, iType3, iType4 >::type
664 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
665 const iType4 & i4 )
const
667 KOKKOS_ASSERT_SHAPE_BOUNDS_6( m_shape, i0, i1, i2, i3, i4, 0 );
668 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
672 m_ptr_on_device + ( m_storage_size * ( i4 +
675 m_shape.N2 * ( i1 )))) +
676 m_stride.value * i0 ) ,
680 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
681 typename iType3 ,
typename iType4 >
682 KOKKOS_FORCEINLINE_FUNCTION
683 typename Impl::ViewEnableArrayOper< reference_type ,
684 traits,
typename traits::array_layout, 6,
685 iType0, iType1, iType2, iType3, iType4 >::type
686 at(
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
687 const iType4 & i4 ,
int ,
int ,
int )
const
688 {
return operator()(i0,i1,i2,i3,i4); }
694 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
typename iType3 ,
typename iType4 ,
typename iType5 >
695 KOKKOS_FORCEINLINE_FUNCTION
696 typename Impl::ViewEnableArrayOper< reference_type ,
697 traits, LayoutLeft, 7, iType0, iType1, iType2, iType3, iType4, iType5 >::type
698 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
699 const iType3 & i3 ,
const iType4 & i4 ,
const iType5 & i5 )
const
701 KOKKOS_ASSERT_SHAPE_BOUNDS_7( m_shape, i0, i1, i2, i3, i4, i5, 0 );
702 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
706 m_ptr_on_device + ( i0 + m_stride.value * (
713 m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 * m_shape.N4 * m_shape.N5 ) );
716 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
717 typename iType3 ,
typename iType4 ,
typename iType5 >
718 KOKKOS_FORCEINLINE_FUNCTION
719 typename Impl::ViewEnableArrayOper< reference_type ,
720 traits, LayoutRight, 7, iType0, iType1, iType2, iType3, iType4, iType5 >::type
721 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
722 const iType4 & i4 ,
const iType5 & i5 )
const
724 KOKKOS_ASSERT_SHAPE_BOUNDS_7( m_shape, i0, i1, i2, i3, i4, i5, 0 );
725 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
729 m_ptr_on_device + ( m_storage_size * ( i5 +
733 m_shape.N2 * ( i1 ))))) +
734 m_stride.value * i0 ) ,
738 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
739 typename iType3 ,
typename iType4 ,
typename iType5 >
740 KOKKOS_FORCEINLINE_FUNCTION
741 typename Impl::ViewEnableArrayOper< reference_type ,
742 traits,
typename traits::array_layout, 7,
743 iType0, iType1, iType2, iType3, iType4, iType5 >::type
744 at(
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
745 const iType4 & i4 ,
const iType5 & i5 ,
int ,
int )
const
746 {
return operator()(i0,i1,i2,i3,i4,i5); }
752 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
typename iType3 ,
753 typename iType4 ,
typename iType5 ,
typename iType6 >
754 KOKKOS_FORCEINLINE_FUNCTION
755 typename Impl::ViewEnableArrayOper< reference_type ,
756 traits, LayoutLeft, 8, iType0, iType1, iType2, iType3, iType4, iType5, iType6 >::type
757 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
758 const iType4 & i4 ,
const iType5 & i5 ,
const iType6 & i6 )
const
760 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
761 KOKKOS_ASSERT_SHAPE_BOUNDS_8( m_shape, i0, i1, i2, i3, i4, i5, i6, 0 );
765 m_ptr_on_device + ( i0 + m_stride.value * (
773 m_stride.value * m_shape.N1 * m_shape.N2 * m_shape.N3 * m_shape.N4 * m_shape.N5 * m_shape.N6 ) );
776 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
777 typename iType3 ,
typename iType4 ,
typename iType5,
typename iType6 >
778 KOKKOS_FORCEINLINE_FUNCTION
779 typename Impl::ViewEnableArrayOper< reference_type ,
780 traits, LayoutRight, 8, iType0, iType1, iType2, iType3, iType4, iType5, iType6 >::type
781 operator() (
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
782 const iType4 & i4 ,
const iType5 & i5 ,
const iType6 & i6 )
const
784 KOKKOS_ASSERT_SHAPE_BOUNDS_8( m_shape, i0, i1, i2, i3, i4, i5, i6, 0 );
785 KOKKOS_RESTRICT_EXECUTION_TO_DATA(
typename traits::memory_space , m_ptr_on_device );
789 m_ptr_on_device + ( m_storage_size * ( i6 +
794 m_shape.N2 * ( i1 )))))) +
795 m_stride.value * i0 ) ,
799 template<
typename iType0 ,
typename iType1 ,
typename iType2 ,
800 typename iType3 ,
typename iType4 ,
typename iType5,
typename iType6 >
801 KOKKOS_FORCEINLINE_FUNCTION
802 typename Impl::ViewEnableArrayOper< reference_type ,
803 traits,
typename traits::array_layout, 8,
804 iType0, iType1, iType2, iType3, iType4, iType5, iType6 >::type
805 at(
const iType0 & i0 ,
const iType1 & i1 ,
const iType2 & i2 ,
const iType3 & i3 ,
806 const iType4 & i4 ,
const iType5 & i5 ,
const iType6 & i6 ,
int )
const
807 {
return operator()(i0,i1,i2,i3,i4,i5,i6); }
813 KOKKOS_FORCEINLINE_FUNCTION
814 typename traits::value_type::storage_type::value_type *
815 data()
const {
return m_ptr_on_device ; }
818 template<
typename iType >
819 KOKKOS_FORCEINLINE_FUNCTION
821 { Impl::stride( s , m_array_shape , m_stride ); }
824 KOKKOS_FORCEINLINE_FUNCTION
826 {
return Impl::capacity( m_array_shape , m_stride ); }
829 KOKKOS_FORCEINLINE_FUNCTION
831 {
return m_sacado_size.value; }
840void deep_copy(
const View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced> & dst ,
841 const View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced> & src ,
842 typename Impl::enable_if<(
843 Impl::is_same<
typename View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced>::intinsic_scalar_type ,
844 typename View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced>::intinsic_scalar_type >::value
846 Impl::is_same<
typename View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced>::array_layout ,
847 typename View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced>::array_layout >::value
849 (
unsigned(View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced>::rank) ==
850 unsigned(View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced>::rank) )
853 typedef View<DT,DL,DD,DM,Impl::ViewMPVectorInterlaced> dst_type ;
854 typedef View<ST,SL,SD,SM,Impl::ViewMPVectorInterlaced> src_type ;
856 typedef typename dst_type::memory_space dst_memory_space ;
857 typedef typename src_type::memory_space src_memory_space ;
859 if ( dst.data() != src.data() ) {
861 Impl::assert_shapes_are_equal( dst.shape() , src.shape() );
863 const size_t nbytes =
sizeof(
typename dst_type::value_type::storage_type::value_type) * dst.span();
865 Impl::DeepCopy< dst_memory_space , src_memory_space >( dst.data() , src.data() , nbytes );
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.