// Create a view from the given dimension arguments.
// This is only necessary because the shmem constructor doesn't take a layout.
template <typename ViewType, typename ViewArg>
static ViewType createView( const ViewArg& arg
, const size_t N0
, const size_t N1
, const size_t N2
, const size_t N3
, const size_t N4
, const size_t N5
, const size_t N6
, const size_t N7 )
{
return ViewType( arg
, N0 != 0 ? N0 : 1
, N1 != 0 ? N1 : 1
, N2 != 0 ? N2 : 1
, N3 != 0 ? N3 : 1
, N4 != 0 ? N4 : 1
, N5 != 0 ? N5 : 1
, N6 != 0 ? N6 : 1
, N7 != 0 ? N7 : 1 );
}
};
} //end Impl
/* \class DynRankView
* \brief Container that creates a Kokkos view with rank determined at runtime.
* Essentially this is a rank 7 view that wraps the access operators
* to yield the functionality of a view
*
* Changes from View
* 1. The rank of the DynRankView is returned by the method rank()
* 2. Max rank of a DynRankView is 7
* 3. subview name is subdynrankview
* 4. Every subdynrankview is returned with LayoutStride
*
*/
template< typename DataType , class ... Properties >
class DynRankView : private View< DataType*******, Properties... >
{
static_assert( !std::is_array<DataType>::value && !std::is_pointer<DataType>::value , "Cannot template DynRankView with array or pointer datatype - must be pod" );
public:
using view_type = View< DataType******* , Properties...>;
using reference_type = typename view_type::reference_type;
private:
template < class , class ... > friend class DynRankView ;
template< class , class ... > friend class Impl::ViewMapping ;