Wrapper around a Kokkos::View that allows data that is constant or repeating in various logical dimensions to be stored just once, while providing a similar interface to that of View.
More...
|
template<class BinaryOperator , class PolicyType , class ThisUnderlyingViewType , class AUnderlyingViewType , class BUnderlyingViewType , class ArgExtractorThis , class ArgExtractorA , class ArgExtractorB > |
void | storeInPlaceCombination (PolicyType &policy, ThisUnderlyingViewType &this_underlying, AUnderlyingViewType &A_underlying, BUnderlyingViewType &B_underlying, BinaryOperator &binaryOperator, ArgExtractorThis argThis, ArgExtractorA argA, ArgExtractorB argB) |
| storeInPlaceCombination implementation for rank < 7, with compile-time underlying views and argument interpretation. Intended for internal and expert use.
|
|
template<class BinaryOperator , int rank> |
enable_if_t< rank !=7, void > | storeInPlaceCombination (const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B, BinaryOperator binaryOperator) |
| storeInPlaceCombination with compile-time rank – implementation for rank < 7.
|
|
template<class BinaryOperator , int rank> |
enable_if_t< rank==7, void > | storeInPlaceCombination (const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B, BinaryOperator binaryOperator) |
| storeInPlaceCombination with compile-time rank – implementation for rank of 7. (Not optimized; expectation is this case will be rarely used.)
|
|
template<class UnaryOperator > |
void | applyOperator (UnaryOperator unaryOperator) |
| applies the specified unary operator to each entry
|
|
template<class ... IntArgs> |
KOKKOS_INLINE_FUNCTION reference_type | getWritableEntry (const IntArgs... intArgs) const |
| Returns an l-value reference to the specified logical entry in the underlying view. Note that for variation types other than GENERAL, multiple valid argument sets will refer to the same memory location. Intended for Intrepid2 developers and expert users only.
|
|
void | allocateAndCopyFromDynRankView (ScalarView< DataScalar, DeviceType > data) |
| allocate an underlying View that matches the provided DynRankView in dimensions, and copy. Called by constructors that accept a DynRankView as argument.
|
|
| Data (std::vector< DimensionInfo > dimInfoVector) |
| Constructor in terms of DimensionInfo for each logical dimension; does not require a View to be specified. Will allocate a View of appropriate rank, zero-filled.
|
|
| Data (const ScalarView< DataScalar, DeviceType > &data, int rank, Kokkos::Array< int, 7 > extents, Kokkos::Array< DataVariationType, 7 > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
| DynRankView constructor. Will copy to a View of appropriate rank.
|
|
template<typename OtherDeviceType , class = typename std::enable_if< std::is_same<typename DeviceType::memory_space, typename OtherDeviceType::memory_space>::value>::type, class = typename std::enable_if<!std::is_same<DeviceType,OtherDeviceType>::value>::type> |
| Data (const Data< DataScalar, OtherDeviceType > &data) |
| copy-like constructor for differing device type, but same memory space. This does a shallow copy of the underlying view.
|
|
template<typename OtherDeviceType , class = typename std::enable_if<!std::is_same<typename DeviceType::memory_space, typename OtherDeviceType::memory_space>::value>::type> |
| Data (const Data< DataScalar, OtherDeviceType > &data) |
| copy-like constructor for differing execution spaces. This does a deep_copy of the underlying view.
|
|
| Data (ScalarView< DataScalar, DeviceType > data) |
| copy constructor modeled after the copy-like constructor above. Not as efficient as the implicit copy constructor, so this should only be uncommented to emulate the copy-like constructor above in situations where host and device space are the same, and the copy-like constructor does not exist, or to provide a debugging breakpoint to assess when copies are being constructed. More...
|
|
template<size_t rank, class ... DynRankViewProperties> |
| Data (const Kokkos::DynRankView< DataScalar, DeviceType, DynRankViewProperties... > &data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
| Constructor that accepts a DynRankView as an argument. The data belonging to the DynRankView will be copied into a new View of matching dimensions.
|
|
template<size_t rank, class ... ViewProperties> |
| Data (Kokkos::View< DataScalar *, DeviceType, ViewProperties... > data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
|
template<size_t rank, class ... ViewProperties> |
| Data (Kokkos::View< DataScalar **, DeviceType, ViewProperties... > data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
|
template<size_t rank, class ... ViewProperties> |
| Data (Kokkos::View< DataScalar ***, DeviceType, ViewProperties... > data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
|
template<size_t rank, class ... ViewProperties> |
| Data (Kokkos::View< DataScalar ****, DeviceType, ViewProperties... > data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
|
template<size_t rank, class ... ViewProperties> |
| Data (Kokkos::View< DataScalar *****, DeviceType, ViewProperties... > data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
|
template<size_t rank, class ... ViewProperties> |
| Data (Kokkos::View< DataScalar ******, DeviceType, ViewProperties... > data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
|
template<size_t rank, class ... ViewProperties> |
| Data (Kokkos::View< DataScalar *******, DeviceType, ViewProperties... > data, Kokkos::Array< int, rank > extents, Kokkos::Array< DataVariationType, rank > variationType, const int blockPlusDiagonalLastNonDiagonal=-1) |
|
template<size_t rank> |
| Data (DataScalar constantValue, Kokkos::Array< int, rank > extents) |
| constructor for everywhere-constant data
|
|
| Data () |
| default constructor (empty data)
|
|
KOKKOS_INLINE_FUNCTION const int & | blockPlusDiagonalLastNonDiagonal () const |
| For a Data object containing data with variation type BLOCK_PLUS_DIAGONAL, returns the row and column (which must match) of the last non-diagonal entry. For fully diagonal matrices, this is -1.
|
|
KOKKOS_INLINE_FUNCTION Kokkos::Array< int, 7 > | getExtents () const |
| Returns an array containing the logical extents in each dimension.
|
|
KOKKOS_INLINE_FUNCTION DimensionInfo | getDimensionInfo (const int &dim) const |
| Returns an object fully specifying the indicated dimension. This is used in determining appropriate sizing of Data objects that depend on other Data objects (e.g., when two matrix Data objects are multiplied together).
|
|
KOKKOS_INLINE_FUNCTION DimensionInfo | combinedDataDimensionInfo (const Data &otherData, const int &dim) const |
| Returns (DataVariationType, data extent) in the specified dimension for a Data container that combines (through multiplication, say, or addition) this container with otherData.
|
|
template<int rank> |
KOKKOS_INLINE_FUNCTION enable_if_t< rank==1, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > | getUnderlyingView () const |
| Returns the underlying view. Throws an exception if the underlying view is not rank 1.
|
|
template<int rank> |
KOKKOS_INLINE_FUNCTION enable_if_t< rank==2, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > | getUnderlyingView () const |
| Returns the underlying view. Throws an exception if the underlying view is not rank 2.
|
|
template<int rank> |
KOKKOS_INLINE_FUNCTION enable_if_t< rank==3, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > | getUnderlyingView () const |
| Returns the underlying view. Throws an exception if the underlying view is not rank 3.
|
|
template<int rank> |
KOKKOS_INLINE_FUNCTION enable_if_t< rank==4, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > | getUnderlyingView () const |
| Returns the underlying view. Throws an exception if the underlying view is not rank 4.
|
|
template<int rank> |
KOKKOS_INLINE_FUNCTION enable_if_t< rank==5, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > | getUnderlyingView () const |
| Returns the underlying view. Throws an exception if the underlying view is not rank 5.
|
|
template<int rank> |
KOKKOS_INLINE_FUNCTION enable_if_t< rank==6, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > | getUnderlyingView () const |
| Returns the underlying view. Throws an exception if the underlying view is not rank 6.
|
|
template<int rank> |
KOKKOS_INLINE_FUNCTION enable_if_t< rank==7, const Kokkos::View< typename RankExpander< DataScalar, rank >::value_type, DeviceType > & > | getUnderlyingView () const |
| Returns the underlying view. Throws an exception if the underlying view is not rank 7.
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::View< DataScalar *, DeviceType > & | getUnderlyingView1 () const |
| returns the View that stores the unique data. For rank-1 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::View< DataScalar **, DeviceType > & | getUnderlyingView2 () const |
| returns the View that stores the unique data. For rank-2 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::View< DataScalar ***, DeviceType > & | getUnderlyingView3 () const |
| returns the View that stores the unique data. For rank-3 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::View< DataScalar ****, DeviceType > & | getUnderlyingView4 () const |
| returns the View that stores the unique data. For rank-4 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::View< DataScalar *****, DeviceType > & | getUnderlyingView5 () const |
| returns the View that stores the unique data. For rank-5 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::View< DataScalar ******, DeviceType > & | getUnderlyingView6 () const |
| returns the View that stores the unique data. For rank-6 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::View< DataScalar *******, DeviceType > & | getUnderlyingView7 () const |
| returns the View that stores the unique data. For rank-7 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION void | setUnderlyingView1 (Kokkos::View< DataScalar *, DeviceType > &view) const |
| sets the View that stores the unique data. For rank-1 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION void | setUnderlyingView2 (Kokkos::View< DataScalar **, DeviceType > &view) const |
| sets the View that stores the unique data. For rank-2 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION void | setUnderlyingView3 (Kokkos::View< DataScalar ***, DeviceType > &view) const |
| sets the View that stores the unique data. For rank-3 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION void | setUnderlyingView4 (Kokkos::View< DataScalar ****, DeviceType > &view) const |
| sets the View that stores the unique data. For rank-4 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION void | setUnderlyingView5 (Kokkos::View< DataScalar *****, DeviceType > &view) const |
| sets the View that stores the unique data. For rank-5 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION void | setUnderlyingView6 (Kokkos::View< DataScalar ******, DeviceType > &view) const |
| sets the View that stores the unique data. For rank-6 underlying containers.
|
|
KOKKOS_INLINE_FUNCTION void | setUnderlyingView7 (Kokkos::View< DataScalar *******, DeviceType > &view) const |
| sets the View that stores the unique data. For rank-7 underlying containers.
|
|
ScalarView< DataScalar, DeviceType > | getUnderlyingView () const |
| Returns a DynRankView constructed atop the same underlying data as the fixed-rank Kokkos::View used internally.
|
|
KOKKOS_INLINE_FUNCTION ordinal_type | getUnderlyingViewRank () const |
| returns the rank of the View that stores the unique data
|
|
KOKKOS_INLINE_FUNCTION ordinal_type | getUnderlyingViewSize () const |
| returns the number of entries in the View that stores the unique data
|
|
ScalarView< DataScalar, DeviceType > | allocateDynRankViewMatchingUnderlying () const |
| Returns a DynRankView that matches the underlying Kokkos::View object in value_type, layout, and dimension.
|
|
template<class ... DimArgs> |
ScalarView< DataScalar, DeviceType > | allocateDynRankViewMatchingUnderlying (DimArgs... dims) const |
| Returns a DynRankView that matches the underlying Kokkos::View object value_type and layout, but with the specified dimensions.
|
|
void | clear () const |
| Copies 0.0 to the underlying View.
|
|
void | copyDataFromDynRankViewMatchingUnderlying (const ScalarView< DataScalar, DeviceType > &dynRankView) const |
| Copies from the provided DynRankView into the underlying Kokkos::View container storing the unique data.
|
|
KOKKOS_INLINE_FUNCTION int | getDataExtent (const ordinal_type &d) const |
| returns the true extent of the data corresponding to the logical dimension provided; if the data does not vary in that dimension, returns 1
|
|
KOKKOS_INLINE_FUNCTION int | getVariationModulus (const int &d) const |
| Variation modulus accessor. More...
|
|
KOKKOS_INLINE_FUNCTION const Kokkos::Array< DataVariationType, 7 > & | getVariationTypes () const |
| Returns an array with the variation types in each logical dimension.
|
|
template<class ... IntArgs> |
KOKKOS_INLINE_FUNCTION return_type | getEntry (const IntArgs &... intArgs) const |
| Returns a (read-only) value corresponding to the specified logical data location.
|
|
template<class ... IntArgs> |
KOKKOS_INLINE_FUNCTION enable_if_t< valid_args< IntArgs... >::value &&(sizeof...(IntArgs)<=7), return_type > | operator() (const IntArgs &... intArgs) const |
| Returns a value corresponding to the specified logical data location.
|
|
KOKKOS_INLINE_FUNCTION int | extent_int (const int &r) const |
| Returns the logical extent in the specified dimension.
|
|
template<typename iType > |
KOKKOS_INLINE_FUNCTION constexpr std::enable_if< std::is_integral< iType >::value, size_t >::type | extent (const iType &r) const |
|
KOKKOS_INLINE_FUNCTION bool | isDiagonal () const |
| returns true for containers that have two dimensions marked as BLOCK_PLUS_DIAGONAL for which the non-diagonal block is empty or size 1.
|
|
template<int rank> |
enable_if_t<(rank!=1) &&(rank!=7), Kokkos::MDRangePolicy< typename DeviceType::execution_space, Kokkos::Rank< rank > > > | dataExtentRangePolicy () |
| returns an MDRangePolicy over the underlying data extents (but with the logical shape).
|
|
template<int rank> |
enable_if_t< rank==7, Kokkos::MDRangePolicy< typename DeviceType::execution_space, Kokkos::Rank< 6 > > > | dataExtentRangePolicy () |
| returns an MDRangePolicy over the first six underlying data extents (but with the logical shape).
|
|
template<int rank> |
enable_if_t< rank==1, Kokkos::RangePolicy< typename DeviceType::execution_space > > | dataExtentRangePolicy () |
|
template<class BinaryOperator > |
void | storeInPlaceCombination (const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B, BinaryOperator binaryOperator) |
| Places the result of an in-place combination (e.g., entrywise sum) into this data container.
|
|
void | storeInPlaceSum (const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B) |
| stores the in-place (entrywise) sum, A .+ B, into this container.
|
|
void | storeInPlaceProduct (const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B) |
| stores the in-place (entrywise) product, A .* B, into this container.
|
|
void | storeInPlaceDifference (const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B) |
| stores the in-place (entrywise) difference, A .- B, into this container.
|
|
void | storeInPlaceQuotient (const Data< DataScalar, DeviceType > &A, const Data< DataScalar, DeviceType > &B) |
| stores the in-place (entrywise) quotient, A ./ B, into this container.
|
|
void | storeMatVec (const Data< DataScalar, DeviceType > &matData, const Data< DataScalar, DeviceType > &vecData) |
| Places the result of a matrix-vector multiply corresponding to the two provided containers into this Data container. This Data container should have been constructed by a call to allocateMatVecResult(), or should match such a container in underlying data extent and variation types.
|
|
void | storeMatMat (const bool transposeA, const Data< DataScalar, DeviceType > &A_MatData, const bool transposeB, const Data< DataScalar, DeviceType > &B_MatData) |
|
KOKKOS_INLINE_FUNCTION constexpr bool | isValid () const |
| returns true for containers that have data; false for those that don't (namely, those that have been constructed by the default constructor).
|
|
KOKKOS_INLINE_FUNCTION unsigned | rank () const |
| Returns the logical rank of the Data container.
|
|
void | setExtent (const ordinal_type &d, const ordinal_type &newExtent) |
| sets the logical extent in the specified dimension. If needed, the underlying data container is resized. More...
|
|
KOKKOS_INLINE_FUNCTION bool | underlyingMatchesLogical () const |
| Returns true if the underlying container has exactly the same rank and extents as the logical container.
|
|