50 #ifndef KOKKOS_DUALVIEW_HPP 
   51 #define KOKKOS_DUALVIEW_HPP 
   53 #include <Kokkos_Core.hpp> 
   54 #include <impl/Kokkos_Error.hpp> 
   93 template< 
class DataType ,
 
   94           class Arg1Type = void ,
 
   95           class Arg2Type = void ,
 
   96           class Arg3Type = 
void>
 
   97 class DualView : 
public ViewTraits< DataType , Arg1Type , Arg2Type, Arg3Type >
 
   99 template< 
class , 
class , 
class , 
class > 
friend class DualView ;
 
  103   typedef ViewTraits< DataType , Arg1Type , Arg2Type, Arg3Type > traits ;
 
  106   typedef typename traits::host_mirror_space host_mirror_space ;
 
  109   typedef View< 
typename traits::data_type ,
 
  120   typedef View< 
typename traits::const_data_type ,
 
  123                 Arg3Type > t_dev_const ;
 
  130   typedef View< 
typename traits::const_data_type ,
 
  131                 typename traits::array_layout ,
 
  132                 typename traits::device_type ,
 
  133                 Kokkos::MemoryTraits<Kokkos::RandomAccess> > t_dev_const_randomread ;
 
  141   typedef View< 
typename traits::data_type ,
 
  142                 typename traits::array_layout ,
 
  143                 typename traits::device_type ,
 
  144                 MemoryUnmanaged> t_dev_um;
 
  147   typedef View< 
typename t_host::data_type ,
 
  148                 typename t_host::array_layout ,
 
  149                 typename t_host::device_type ,
 
  150                 MemoryUnmanaged> t_host_um;
 
  153   typedef View< 
typename traits::const_data_type ,
 
  154                 typename traits::array_layout ,
 
  155                 typename traits::device_type ,
 
  156                 MemoryUnmanaged> t_dev_const_um;
 
  159   typedef View<
typename t_host::const_data_type,
 
  160                typename t_host::array_layout,
 
  161                typename t_host::device_type,
 
  162                MemoryUnmanaged> t_host_const_um;
 
  165   typedef View< 
typename t_host::const_data_type ,
 
  166                 typename t_host::array_layout ,
 
  167                 typename t_host::device_type ,
 
  168                 Kokkos::MemoryTraits<Kokkos::Unmanaged|Kokkos::RandomAccess> > t_dev_const_randomread_um ;
 
  186 #ifndef KOKKOS_ENABLE_DEPRECATED_CODE 
  190   typedef View<unsigned int[2],LayoutLeft,Kokkos::HostSpace> t_modified_flags;
 
  191   t_modified_flags modified_flags;
 
  195   typedef View<unsigned int[2],LayoutLeft,typename t_host::execution_space> t_modified_flags;
 
  196   typedef View<unsigned int,LayoutLeft,typename t_host::execution_space> t_modified_flag;
 
  197   t_modified_flags modified_flags;
 
  198   t_modified_flag modified_host,modified_device;
 
  210 #ifndef KOKKOS_ENABLE_DEPRECATED_CODE 
  211   DualView () = 
default;
 
  213   DualView ():modified_flags (t_modified_flags(
"DualView::modified_flags")) {
 
  214     modified_host = t_modified_flag(modified_flags,0);
 
  215     modified_device = t_modified_flag(modified_flags,1);
 
  228   DualView (
const std::string& label,
 
  229             const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
 
  230             const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
 
  231             const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
 
  232             const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
 
  233             const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
 
  234             const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
 
  235             const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG,
 
  236             const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG)
 
  237     : d_view (label, n0, n1, n2, n3, n4, n5, n6, n7)
 
  238     , h_view (create_mirror_view (d_view)) 
 
  239     , modified_flags (t_modified_flags(
"DualView::modified_flags"))
 
  241 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE 
  242     modified_host = t_modified_flag(modified_flags,0);
 
  243     modified_device = t_modified_flag(modified_flags,1);
 
  248   template<
class SS, 
class LS, 
class DS, 
class MS>
 
  249   DualView (
const DualView<SS,LS,DS,MS>& src) :
 
  252     modified_flags (src.modified_flags)
 
  253 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
 
  254     , modified_host(src.modified_host)
 
  255     , modified_device(src.modified_device)
 
  260   template< 
class SD, 
class S1 , 
class S2 , 
class S3
 
  261           , 
class Arg0 , 
class ... Args >
 
  262   DualView( 
const DualView<SD,S1,S2,S3> & src
 
  266     : d_view( Kokkos::subview( src.d_view , arg0 , args ... ) )
 
  267     , h_view( Kokkos::subview( src.h_view , arg0 , args ... ) )
 
  268     , modified_flags (src.modified_flags)
 
  269 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE
 
  270     , modified_host(src.modified_host)
 
  271     , modified_device(src.modified_device)
 
  285   DualView (
const t_dev& d_view_, 
const t_host& h_view_) :
 
  288     modified_flags (t_modified_flags(
"DualView::modified_flags"))
 
  290     if ( 
int(d_view.rank)     != 
int(h_view.rank) ||
 
  291          d_view.extent(0) != h_view.extent(0) ||
 
  292          d_view.extent(1) != h_view.extent(1) ||
 
  293          d_view.extent(2) != h_view.extent(2) ||
 
  294          d_view.extent(3) != h_view.extent(3) ||
 
  295          d_view.extent(4) != h_view.extent(4) ||
 
  296          d_view.extent(5) != h_view.extent(5) ||
 
  297          d_view.extent(6) != h_view.extent(6) ||
 
  298          d_view.extent(7) != h_view.extent(7) ||
 
  299          d_view.stride_0()    != h_view.stride_0() ||
 
  300          d_view.stride_1()    != h_view.stride_1() ||
 
  301          d_view.stride_2()    != h_view.stride_2() ||
 
  302          d_view.stride_3()    != h_view.stride_3() ||
 
  303          d_view.stride_4()    != h_view.stride_4() ||
 
  304          d_view.stride_5()    != h_view.stride_5() ||
 
  305          d_view.stride_6()    != h_view.stride_6() ||
 
  306          d_view.stride_7()    != h_view.stride_7() ||
 
  307          d_view.span()        != h_view.span() ) {
 
  308       Kokkos::Impl::throw_runtime_exception(
"DualView constructed with incompatible views");
 
  310 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE 
  311     modified_host = t_modified_flag(modified_flags,0);
 
  312     modified_device = t_modified_flag(modified_flags,1);
 
  341   template< 
class Device >
 
  342   KOKKOS_INLINE_FUNCTION
 
  343   const typename Impl::if_c<
 
  344     std::is_same<
typename t_dev::memory_space,
 
  345                           typename Device::memory_space>::value,
 
  347     t_host>::type& view ()
 const 
  349     #ifndef KOKKOS_ENABLE_DEPRECATED_CODE 
  350     constexpr 
bool device_is_memspace  = std::is_same<Device,typename Device::memory_space>::value;
 
  351     constexpr 
bool device_is_execspace = std::is_same<Device,typename Device::execution_space>::value;
 
  352     constexpr 
bool device_exec_is_t_dev_exec  = std::is_same<typename Device::execution_space,typename t_dev::execution_space>::value;
 
  353     constexpr 
bool device_mem_is_t_dev_mem    = std::is_same<typename Device::memory_space,typename t_dev::memory_space>::value;
 
  354     constexpr 
bool device_exec_is_t_host_exec  = std::is_same<typename Device::execution_space,typename t_host::execution_space>::value;
 
  355     constexpr 
bool device_mem_is_t_host_mem    = std::is_same<typename Device::memory_space,typename t_host::memory_space>::value;
 
  356     constexpr 
bool device_is_t_host_device  = std::is_same<typename Device::execution_space,typename t_host::device_type>::value;
 
  357     constexpr 
bool device_is_t_dev_device    = std::is_same<typename Device::memory_space,typename t_host::device_type>::value;
 
  360         device_is_t_dev_device || device_is_t_host_device ||
 
  361         (device_is_memspace  && (device_mem_is_t_dev_mem   || device_mem_is_t_host_mem) ) ||
 
  362         (device_is_execspace && (device_exec_is_t_dev_exec || device_exec_is_t_host_exec) ) ||
 
  364           (!device_is_execspace && !device_is_memspace) && (
 
  365             (device_mem_is_t_dev_mem   || device_mem_is_t_host_mem)  ||
 
  366             (device_exec_is_t_dev_exec || device_exec_is_t_host_exec)
 
  370         "Template parameter to .view() must exactly match one of the DualView's device types or one of the execution or memory spaces");
 
  375         typename t_dev::memory_space,
 
  376         typename Device::memory_space>::value,
 
  378       t_host >::select (d_view , h_view);
 
  381   KOKKOS_INLINE_FUNCTION
 
  382   t_host view_host()
 const {
 
  386   KOKKOS_INLINE_FUNCTION
 
  387   t_dev view_device()
 const {
 
  391   template<
class Device>
 
  392   static int get_device_side() {
 
  393     constexpr 
bool device_is_memspace  = std::is_same<Device,typename Device::memory_space>::value;
 
  394     constexpr 
bool device_is_execspace = std::is_same<Device,typename Device::execution_space>::value;
 
  395     constexpr 
bool device_exec_is_t_dev_exec  = std::is_same<typename Device::execution_space,typename t_dev::execution_space>::value;
 
  396     constexpr 
bool device_mem_is_t_dev_mem    = std::is_same<typename Device::memory_space,typename t_dev::memory_space>::value;
 
  397     constexpr 
bool device_exec_is_t_host_exec  = std::is_same<typename Device::execution_space,typename t_host::execution_space>::value;
 
  398     constexpr 
bool device_mem_is_t_host_mem    = std::is_same<typename Device::memory_space,typename t_host::memory_space>::value;
 
  399     constexpr 
bool device_is_t_host_device  = std::is_same<typename Device::execution_space,typename t_host::device_type>::value;
 
  400     constexpr 
bool device_is_t_dev_device    = std::is_same<typename Device::memory_space,typename t_host::device_type>::value;
 
  402     #ifndef KOKKOS_ENABLE_DEPRECATED_CODE 
  404         device_is_t_dev_device || device_is_t_host_device ||
 
  405         (device_is_memspace  && (device_mem_is_t_dev_mem   || device_mem_is_t_host_mem) ) ||
 
  406         (device_is_execspace && (device_exec_is_t_dev_exec || device_exec_is_t_host_exec) ) ||
 
  408           (!device_is_execspace && !device_is_memspace) && (
 
  409             (device_mem_is_t_dev_mem   || device_mem_is_t_host_mem)  ||
 
  410             (device_exec_is_t_dev_exec || device_exec_is_t_host_exec)
 
  414         "Template parameter to .sync() must exactly match one of the DualView's device types or one of the execution or memory spaces");
 
  417     #ifndef KOKKOS_ENABLE_DEPRECATED_CODE 
  422     if(device_is_t_dev_device) dev = 1;
 
  423     else if(device_is_t_host_device) dev = 0;
 
  425       if(device_is_memspace) {
 
  426         if(device_mem_is_t_dev_mem) dev = 1;
 
  427         if(device_mem_is_t_host_mem) dev = 0;
 
  428         if(device_mem_is_t_host_mem && device_mem_is_t_dev_mem) dev = -1;
 
  430       if(device_is_execspace) {
 
  431         if(device_exec_is_t_dev_exec) dev = 1;
 
  432         if(device_exec_is_t_host_exec) dev = 0;
 
  433         if(device_exec_is_t_host_exec && device_exec_is_t_dev_exec) dev = -1;
 
  435       if(!device_is_execspace && !device_is_memspace) {
 
  436         if(device_mem_is_t_dev_mem) dev = 1;
 
  437         if(device_mem_is_t_host_mem) dev = 0;
 
  438         if(device_mem_is_t_host_mem && device_mem_is_t_dev_mem) dev = -1;
 
  439         if(device_exec_is_t_dev_exec) dev = 1;
 
  440         if(device_exec_is_t_host_exec) dev = 0;
 
  441         if(device_exec_is_t_host_exec && device_exec_is_t_dev_exec) dev = -1;
 
  464   template<
class Device>
 
  465   void sync( 
const typename Impl::enable_if<
 
  466         ( std::is_same< typename traits::data_type , typename traits::non_const_data_type>::value) ||
 
  467         ( std::is_same< Device , int>::value)
 
  470     if(modified_flags.data()==NULL) 
return;
 
  472     int dev = get_device_side<Device>();
 
  475       if ((modified_flags(0) > 0) && (modified_flags(0) >= modified_flags(1))) {
 
  477         modified_flags(0) = modified_flags(1) = 0;
 
  481       if ((modified_flags(1) > 0) && (modified_flags(1) >= modified_flags(0))) {
 
  483         modified_flags(0) = modified_flags(1) = 0;
 
  486     if(std::is_same<typename t_host::memory_space,typename t_dev::memory_space>::value) {
 
  487       typename t_dev::execution_space().fence();
 
  488       typename t_host::execution_space().fence();
 
  492   template<
class Device>
 
  493   void sync ( 
const typename Impl::enable_if<
 
  494       ( ! std::is_same< typename traits::data_type , typename traits::non_const_data_type>::value ) ||
 
  495       ( std::is_same< Device , int>::value)
 
  498     if(modified_flags.data()==NULL) 
return;
 
  500     int dev = get_device_side<Device>();
 
  503       if ((modified_flags(0) > 0) && (modified_flags(0) >= modified_flags(1))) {
 
  504         Impl::throw_runtime_exception(
"Calling sync on a DualView with a const datatype.");
 
  508       if ((modified_flags(1) > 0) && (modified_flags(1) >= modified_flags(0))) {
 
  509         Impl::throw_runtime_exception(
"Calling sync on a DualView with a const datatype.");
 
  515     if( ! std::is_same< typename traits::data_type , typename traits::non_const_data_type>::value )
 
  516       Impl::throw_runtime_exception(
"Calling sync_host on a DualView with a const datatype.");
 
  517     if(modified_flags.data()==NULL) 
return;
 
  518     if(modified_flags(1) > modified_flags(0)) {
 
  520       modified_flags(1) = modified_flags(0) = 0;
 
  525     if( ! std::is_same< typename traits::data_type , typename traits::non_const_data_type>::value )
 
  526       Impl::throw_runtime_exception(
"Calling sync_device on a DualView with a const datatype.");
 
  527     if(modified_flags.data()==NULL) 
return;
 
  528     if(modified_flags(0) > modified_flags(1)) {
 
  530       modified_flags(1) = modified_flags(0) = 0;
 
  534   template<
class Device>
 
  535   bool need_sync()
 const 
  537     if(modified_flags.data()==NULL) 
return false;
 
  538     int dev = get_device_side<Device>();
 
  541       if ((modified_flags(0) > 0) && (modified_flags(0) >= modified_flags(1))) {
 
  546       if ((modified_flags(1) > 0) && (modified_flags(1) >= modified_flags(0))) {
 
  553   inline bool need_sync_host()
 const {
 
  554     if(modified_flags.data()==NULL) 
return false;
 
  555     return modified_flags(0)<modified_flags(1);
 
  558   inline bool need_sync_device()
 const {
 
  559     if(modified_flags.data()==NULL) 
return false;
 
  560     return modified_flags(1)<modified_flags(0);
 
  568   template<
class Device>
 
  570     if(modified_flags.data()==NULL) 
return;
 
  571     int dev = get_device_side<Device>();
 
  575       modified_flags(1) = (modified_flags(1) > modified_flags(0) ?
 
  576                             modified_flags(1) : modified_flags(0)) + 1;
 
  580       modified_flags(0) = (modified_flags(1) > modified_flags(0) ?
 
  581                           modified_flags(1) : modified_flags(0))  + 1;
 
  584 #ifdef KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK 
  585     if (modified_flags(0) && modified_flags(1)) {
 
  586       std::string msg = 
"Kokkos::DualView::modify ERROR: ";
 
  587       msg += 
"Concurrent modification of host and device views ";
 
  588       msg += 
"in DualView \"";
 
  589       msg += d_view.label();
 
  591       Kokkos::abort(msg.c_str());
 
  596   inline void modify_host() {
 
  597     if(modified_flags.data()!=NULL) {
 
  598       modified_flags(0) = (modified_flags(1) > modified_flags(0) ?
 
  599           modified_flags(1) : modified_flags(0))  + 1;
 
  600       #ifdef KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK 
  601       if (modified_flags(0) && modified_flags(1)) {
 
  602         std::string msg = 
"Kokkos::DualView::modify_host ERROR: ";
 
  603         msg += 
"Concurrent modification of host and device views ";
 
  604         msg += 
"in DualView \"";
 
  605         msg += d_view.label();
 
  607         Kokkos::abort(msg.c_str());
 
  613   inline void modify_device() {
 
  614     if(modified_flags.data()!=NULL) {
 
  615       modified_flags(1) = (modified_flags(1) > modified_flags(0) ?
 
  616           modified_flags(1) : modified_flags(0))  + 1;
 
  617       #ifdef KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK 
  618       if (modified_flags(0) && modified_flags(1)) {
 
  619         std::string msg = 
"Kokkos::DualView::modify_device ERROR: ";
 
  620         msg += 
"Concurrent modification of host and device views ";
 
  621         msg += 
"in DualView \"";
 
  622         msg += d_view.label();
 
  624         Kokkos::abort(msg.c_str());
 
  630   inline void clear_sync_state() {
 
  631     if(modified_flags.data()!=NULL) 
 
  632       modified_flags(1) = modified_flags(0) = 0;
 
  644   void realloc( 
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  645            const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  646            const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  647            const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  648            const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  649            const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  650            const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  651            const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ) {
 
  653      h_view = create_mirror_view( d_view );
 
  656      if(modified_flags.data()==NULL) {
 
  657        modified_flags = t_modified_flags(
"DualView::modified_flags");
 
  659        modified_flags(1) = modified_flags(0) = 0;
 
  666   void resize( 
const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  667            const size_t n1 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  668            const size_t n2 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  669            const size_t n3 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  670            const size_t n4 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  671            const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  672            const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ,
 
  673            const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG ) {
 
  674    if(modified_flags.data()==NULL) {
 
  675      modified_flags = t_modified_flags(
"DualView::modified_flags");
 
  677    if(modified_flags(1) >= modified_flags(0)) {
 
  680      h_view = create_mirror_view( d_view );
 
  683      modified_flags(1) = modified_flags(1)+1;
 
  690      const bool sizeMismatch = ( h_view.extent(0) != n0 ) ||
 
  691          ( h_view.extent(1) != n1 ) ||
 
  692          ( h_view.extent(2) != n2 ) ||
 
  693          ( h_view.extent(3) != n3 ) ||
 
  694          ( h_view.extent(4) != n4 ) ||
 
  695          ( h_view.extent(5) != n5 ) ||
 
  696          ( h_view.extent(6) != n6 ) ||
 
  697          ( h_view.extent(7) != n7 );
 
  701      t_host temp_view = create_mirror_view( d_view );
 
  708      d_view = create_mirror_view( 
typename t_dev::execution_space(), h_view );
 
  711      modified_flags(0) = modified_flags(0)+1;
 
  719 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE 
  720   size_t capacity()
 const {
 
  722     return d_view.span();
 
  727   KOKKOS_INLINE_FUNCTION constexpr 
size_t span()
 const {
 
  728     return d_view.span();
 
  731   KOKKOS_INLINE_FUNCTION 
bool span_is_contiguous()
 const { 
 
  732     return d_view.span_is_contiguous(); 
 
  736   template< 
typename iType>
 
  737   void stride(iType* stride_)
 const {
 
  738     d_view.stride(stride_);
 
  741   template< 
typename iType >
 
  742    KOKKOS_INLINE_FUNCTION constexpr
 
  743    typename std::enable_if< std::is_integral<iType>::value , 
size_t >::type
 
  744    extent( 
const iType & r )
 const 
  745      { 
return d_view.extent(r); }
 
  747    template< 
typename iType >
 
  748    KOKKOS_INLINE_FUNCTION constexpr
 
  749    typename std::enable_if< std::is_integral<iType>::value , 
int >::type
 
  750    extent_int( 
const iType & r )
 const 
  751      { 
return static_cast<int>(d_view.extent(r)); }
 
  753 #ifdef KOKKOS_ENABLE_DEPRECATED_CODE 
  759   size_t dimension_0()
 const {
return d_view.extent(0);}
 
  761   size_t dimension_1()
 const {
return d_view.extent(1);}
 
  763   size_t dimension_2()
 const {
return d_view.extent(2);}
 
  765   size_t dimension_3()
 const {
return d_view.extent(3);}
 
  767   size_t dimension_4()
 const {
return d_view.extent(4);}
 
  769   size_t dimension_5()
 const {
return d_view.extent(5);}
 
  771   size_t dimension_6()
 const {
return d_view.extent(6);}
 
  773   size_t dimension_7()
 const {
return d_view.extent(7);}
 
  790 template< 
class D, 
class A1, 
class A2, 
class A3, 
class ... Args >
 
  791 struct DualViewSubview {
 
  793   typedef typename Kokkos::Impl::ViewMapping
 
  797     >::traits_type dst_traits ;
 
  799   typedef Kokkos::DualView
 
  800     < 
typename dst_traits::data_type
 
  801     , 
typename dst_traits::array_layout
 
  802     , 
typename dst_traits::device_type
 
  803     , 
typename dst_traits::memory_traits
 
  810 template< 
class D , 
class A1 , 
class A2 , 
class A3 , 
class ... Args >
 
  811 typename Impl::DualViewSubview<D,A1,A2,A3,Args...>::type
 
  812 subview( 
const DualView<D,A1,A2,A3> & src , Args ... args )
 
  815     Impl::DualViewSubview<D,A1,A2,A3,Args...>::type( src , args ... );
 
  829 template< 
class DT , 
class DL , 
class DD , 
class DM ,
 
  830           class ST , 
class SL , 
class SD , 
class SM >
 
  833            const DualView<ST,SL,SD,SM>& src )
 
  835   if ( src.need_sync_device() ) {
 
  845 template< 
class ExecutionSpace ,
 
  846           class DT , 
class DL , 
class DD , 
class DM ,
 
  847           class ST , 
class SL , 
class SD , 
class SM >
 
  850            DualView<DT,DL,DD,DM> dst, 
 
  851            const DualView<ST,SL,SD,SM>& src )
 
  853   if ( src.need_sync_device() ) {
 
  854     deep_copy (exec, dst.h_view, src.h_view);
 
  857     deep_copy (exec, dst.d_view, src.d_view);
 
std::enable_if< std::is_same< typename Kokkos::View< T, P...>::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::View< T, P...>::array_layout, Kokkos::LayoutRight >::value >::type resize(Kokkos::View< T, P...> &v, const size_t n0=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n1=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n2=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n3=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n4=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n5=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n6=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n7=KOKKOS_IMPL_CTOR_DEFAULT_ARG)
Resize a view with copying old data to new data at the corresponding indices. 
 
void deep_copy(const View< DT, DP...> &dst, typename ViewTraits< DT, DP...>::const_value_type &value, typename std::enable_if< std::is_same< typename ViewTraits< DT, DP...>::specialize, void >::value >::type *=0)
Deep copy a value from Host memory into a view. 
 
void resize(DynRankView< T, P...> &v, const size_t n0=KOKKOS_INVALID_INDEX, const size_t n1=KOKKOS_INVALID_INDEX, const size_t n2=KOKKOS_INVALID_INDEX, const size_t n3=KOKKOS_INVALID_INDEX, const size_t n4=KOKKOS_INVALID_INDEX, const size_t n5=KOKKOS_INVALID_INDEX, const size_t n6=KOKKOS_INVALID_INDEX, const size_t n7=KOKKOS_INVALID_INDEX)
Resize a view with copying old data to new data at the corresponding indices. 
 
std::enable_if< std::is_same< typename Kokkos::View< T, P...>::array_layout, Kokkos::LayoutLeft >::value||std::is_same< typename Kokkos::View< T, P...>::array_layout, Kokkos::LayoutRight >::value >::type realloc(Kokkos::View< T, P...> &v, const size_t n0=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n1=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n2=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n3=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n4=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n5=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n6=KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n7=KOKKOS_IMPL_CTOR_DEFAULT_ARG)
Resize a view with discarding old data. 
 
void realloc(DynRankView< T, P...> &v, const size_t n0=KOKKOS_INVALID_INDEX, const size_t n1=KOKKOS_INVALID_INDEX, const size_t n2=KOKKOS_INVALID_INDEX, const size_t n3=KOKKOS_INVALID_INDEX, const size_t n4=KOKKOS_INVALID_INDEX, const size_t n5=KOKKOS_INVALID_INDEX, const size_t n6=KOKKOS_INVALID_INDEX, const size_t n7=KOKKOS_INVALID_INDEX)
Resize a view with copying old data to new data at the corresponding indices. 
 
View< typename traits::non_const_data_type, typename traits::array_layout, typename traits::host_mirror_space > HostMirror
Compatible HostMirror view. 
 
Traits class for accessing attributes of a View.