LvArray
ArrayView.hpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2021, Lawrence Livermore National Security, LLC and LvArray contributors.
3  * All rights reserved.
4  * See the LICENSE file for details.
5  * SPDX-License-Identifier: (BSD-3-Clause)
6  */
7 
13 #pragma once
14 
15 // Source includes
16 #include "ArraySlice.hpp"
17 #include "Macros.hpp"
18 #include "indexing.hpp"
19 #include "limits.hpp"
20 #include "sliceHelpers.hpp"
21 #include "bufferManipulation.hpp"
22 #include "umpireInterface.hpp"
23 
24 // System includes
25 #if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__)
26 #include "totalview/tv_helpers.hpp"
28 #endif
29 
30 namespace LvArray
31 {
32 
63 template< typename T,
64  int NDIM_TPARAM,
65  int USD_TPARAM,
66  typename INDEX_TYPE,
67  template< typename > class BUFFER_TYPE >
68 class ArrayView
69 {
70 public:
71 
72  static_assert( NDIM_TPARAM > 0, "Number of dimensions must be greater than zero." );
73  static_assert( USD_TPARAM >= 0, "USD must be positive." );
74  static_assert( USD_TPARAM < NDIM_TPARAM, "USD must be less than NDIM." );
75 
77  using ValueType = T;
78 
80  static constexpr int NDIM = NDIM_TPARAM;
81 
83  static constexpr int USD = USD_TPARAM;
84 
86  using IndexType = INDEX_TYPE;
87 
89  using ViewTypeConst = ArrayView< std::remove_const_t< T > const, NDIM, USD, INDEX_TYPE, BUFFER_TYPE >;
90 
91 
94  NDIM, USD, INDEX_TYPE, BUFFER_TYPE >;
95 
98  NDIM, USD, INDEX_TYPE, BUFFER_TYPE >;
99 
102 
105 
107  using value_type = T;
108 
110  using size_type = INDEX_TYPE;
111 
115 
121  ArrayView() = default;
122 
130  inline LVARRAY_HOST_DEVICE constexpr
131  ArrayView( ArrayView const & source ) noexcept:
132  m_dims{ source.m_dims },
133  m_strides{ source.m_strides },
134  m_dataBuffer{ source.m_dataBuffer, source.size() },
135  m_singleParameterResizeIndex( source.m_singleParameterResizeIndex )
136  {}
137 
153  template< typename U, typename=std::enable_if_t< !std::is_same< T, U >::value > >
154  inline LVARRAY_HOST_DEVICE constexpr
156  m_dims{ source.dimsArray() },
157  m_strides{ source.stridesArray() },
158  m_dataBuffer{ source.dataBuffer() },
159  m_singleParameterResizeIndex( source.getSingleParameterResizeIndex() )
160  {
161  m_dims[ USD ] = typeManipulation::convertSize< T, U >( m_dims[ USD ] );
162 
163  for( int i = 0; i < NDIM; ++i )
164  {
165  if( i != USD )
166  {
167  m_strides[ i ] = typeManipulation::convertSize< T, U >( m_strides[ i ] );
168  }
169  }
170  }
171 
188  ArrayView( ArrayView && source ) = default;
189 
197  inline LVARRAY_HOST_DEVICE constexpr explicit
200  int const singleParameterResizeIndex,
201  BUFFER_TYPE< T > const & buffer ):
202  m_dims( dims ),
203  m_strides( strides ),
204  m_dataBuffer( buffer ),
205  m_singleParameterResizeIndex( singleParameterResizeIndex )
206  {}
207 
209  ~ArrayView() = default;
210 
230  inline LVARRAY_HOST_DEVICE LVARRAY_INTEL_CONSTEXPR
232  {
233  m_dataBuffer = std::move( rhs.m_dataBuffer );
234  m_singleParameterResizeIndex = rhs.m_singleParameterResizeIndex;
235  for( int i = 0; i < NDIM; ++i )
236  {
237  m_dims[ i ] = rhs.m_dims[ i ];
238  m_strides[ i ] = rhs.m_strides[ i ];
239  }
240 
241  return *this;
242  }
243 
249  inline LVARRAY_INTEL_CONSTEXPR
250  ArrayView & operator=( ArrayView const & rhs ) noexcept
251  {
252  m_dataBuffer = rhs.m_dataBuffer;
253  m_singleParameterResizeIndex = rhs.m_singleParameterResizeIndex;
254  for( int i = 0; i < NDIM; ++i )
255  {
256  m_dims[ i ] = rhs.m_dims[ i ];
257  m_strides[ i ] = rhs.m_strides[ i ];
258  }
259 
260  return *this;
261  }
262 
264 
268 
273  inline LVARRAY_HOST_DEVICE constexpr
274  ArrayView toView() const &
276 
280  inline LVARRAY_HOST_DEVICE constexpr
282  {
283  return ViewTypeConst( m_dims,
284  m_strides,
286  m_dataBuffer );
287  }
288 
292  inline LVARRAY_HOST_DEVICE constexpr
294  { return reinterpret_cast< NestedViewType const & >( *this ); }
295 
299  inline LVARRAY_HOST_DEVICE constexpr
301  { return reinterpret_cast< NestedViewTypeConst const & >( *this ); }
302 
306  inline LVARRAY_HOST_DEVICE constexpr
308  toSlice() const & noexcept
310 
318  inline LVARRAY_HOST_DEVICE constexpr
320  toSlice() const && noexcept = delete;
321 
325  inline LVARRAY_HOST_DEVICE constexpr
327  toSliceConst() const & noexcept
329 
337  inline LVARRAY_HOST_DEVICE constexpr
339  toSliceConst() const && noexcept = delete;
340 
345  template< typename _T=T >
346  inline LVARRAY_HOST_DEVICE constexpr
347  operator std::enable_if_t< !std::is_const< _T >::value,
349  { return toViewConst(); }
350 
354  inline LVARRAY_HOST_DEVICE constexpr
355  operator ArraySlice< T, NDIM, USD, INDEX_TYPE >() const & noexcept
356  { return toSlice(); }
357 
365  inline LVARRAY_HOST_DEVICE constexpr
366  operator ArraySlice< T, NDIM, USD, INDEX_TYPE >() const && noexcept = delete;
367 
371  template< typename _T=T >
372  inline LVARRAY_HOST_DEVICE constexpr
373  operator std::enable_if_t< !std::is_const< _T >::value,
375  { return toSliceConst(); }
376 
384  template< typename _T=T >
385  inline LVARRAY_HOST_DEVICE constexpr
386  operator std::enable_if_t< !std::is_const< _T >::value,
387  ArraySlice< T const, NDIM, USD, INDEX_TYPE > const >() const && noexcept = delete;
388 
390 
394 
399  LVARRAY_HOST_DEVICE inline constexpr
400  INDEX_TYPE size() const noexcept
401  {
402  #if defined( __ibmxl__ )
403  // Note: This used to be done with a recursive template but XL-release would produce incorrect results.
404  // Specifically in exampleArray it would return an "old" size even after being updated, strange.
405  INDEX_TYPE val = m_dims[ 0 ];
406  for( int i = 1; i < NDIM; ++i )
407  { val *= m_dims[ i ]; }
408 
409  return val;
410  #else
411  return indexing::multiplyAll< NDIM >( m_dims.data );
412  #endif
413  }
414 
420  INDEX_TYPE size( int const dim ) const noexcept
421  {
422 #ifdef LVARRAY_BOUNDS_CHECK
423  LVARRAY_ASSERT_GE( dim, 0 );
424  LVARRAY_ASSERT_GT( NDIM, dim );
425 #endif
426  return m_dims[ dim ];
427  }
428 
432  LVARRAY_HOST_DEVICE inline constexpr
433  bool empty() const
434  { return size() == 0; }
435 
439  LVARRAY_HOST_DEVICE constexpr
440  INDEX_TYPE capacity() const
441  { return LvArray::integerConversion< INDEX_TYPE >( m_dataBuffer.capacity() ); }
442 
446  LVARRAY_HOST_DEVICE inline constexpr
448  { return m_singleParameterResizeIndex; }
449 
455  template< typename ... INDICES >
457  INDEX_TYPE linearIndex( INDICES const ... indices ) const
458  {
459  static_assert( sizeof ... (INDICES) == NDIM, "number of indices does not match NDIM" );
460 #ifdef LVARRAY_BOUNDS_CHECK
461  indexing::checkIndices( m_dims.data, indices ... );
462 #endif
463  return indexing::getLinearIndex< USD >( m_strides.data, indices ... );
464  }
465 
469  LVARRAY_HOST_DEVICE inline constexpr
470  INDEX_TYPE const * dims() const noexcept
471  { return m_dims.data; }
472 
476  LVARRAY_HOST_DEVICE inline constexpr
478  { return m_dims; }
479 
483  LVARRAY_HOST_DEVICE inline constexpr
484  INDEX_TYPE const * strides() const noexcept
485  { return m_strides.data; }
486 
490  LVARRAY_HOST_DEVICE inline constexpr
492  { return m_strides; }
493 
498  LVARRAY_HOST_DEVICE inline constexpr
499  BUFFER_TYPE< T > const & dataBuffer() const
500  { return m_dataBuffer; }
501 
503 
507 
514  template< int _NDIM=NDIM >
516  std::enable_if_t< (_NDIM > 1), ArraySlice< T, NDIM - 1, USD - 1, INDEX_TYPE > >
517  operator[]( INDEX_TYPE const index ) const & noexcept
518  {
519  ARRAY_SLICE_CHECK_BOUNDS( index );
520  return ArraySlice< T, NDIM-1, USD-1, INDEX_TYPE >( data() + indexing::ConditionalMultiply< USD == 0 >::multiply( index, m_strides[ 0 ] ),
521  m_dims.data + 1,
522  m_strides.data + 1 );
523  }
524 
533  template< int _NDIM=NDIM >
535  std::enable_if_t< (_NDIM > 1), ArraySlice< T, NDIM - 1, USD - 1, INDEX_TYPE > >
536  operator[]( INDEX_TYPE const index ) const && noexcept = delete;
537 
543  template< int _NDIM=NDIM >
545  std::enable_if_t< _NDIM == 1, T & >
546  operator[]( INDEX_TYPE const index ) const & noexcept
547  {
548  ARRAY_SLICE_CHECK_BOUNDS( index );
550  }
551 
557  template< typename ... INDICES >
558  LVARRAY_HOST_DEVICE inline constexpr
559  T & operator()( INDICES... indices ) const
560  {
561  static_assert( sizeof ... (INDICES) == NDIM, "number of indices does not match NDIM" );
562  return data()[ linearIndex( indices ... ) ];
563  }
564 
568  LVARRAY_HOST_DEVICE inline constexpr
569  T * data() const
570  { return m_dataBuffer.data(); }
571 
575  LVARRAY_HOST_DEVICE inline constexpr
576  T * begin() const
577  { return data(); }
578 
582  LVARRAY_HOST_DEVICE inline constexpr
583  T * end() const
584  { return data() + size(); }
585 
589  T & front() const
590  { return data()[ 0 ]; }
591 
595  T & back() const
596  { return data()[size() - 1]; }
597 
599 
603 
612  template< typename POLICY >
613  void setValues( T const & value ) const
614  {
615  auto const view = toView();
616  RAJA::forall< POLICY >( RAJA::TypedRangeSegment< INDEX_TYPE >( 0, size() ),
617  [value, view] LVARRAY_HOST_DEVICE ( INDEX_TYPE const i )
618  {
619  view.data()[ i ] = value;
620  } );
621  }
622 
629  inline void zero() const
630  {
631  #if !defined( LVARRAY_USE_UMPIRE )
632  LVARRAY_ERROR_IF_NE_MSG( getPreviousSpace(), MemorySpace::host, "Without Umpire only host memory is supported." );
633  #endif
634 
635  if( size() > 0 )
636  {
637  move( getPreviousSpace(), true );
638  umpireInterface::memset( data(), 0, size() * sizeof( T ) );
639  }
640  }
641 
647  template< typename POLICY >
649  {
650  for( int dim = 0; dim < NDIM; ++dim )
651  {
652  LVARRAY_ERROR_IF_NE( size( dim ), rhs.size( dim ) );
653  LVARRAY_ERROR_IF_NE_MSG( strides()[ dim ], rhs.strides()[ dim ],
654  "This method only works with Arrays with the same data layout." );
655  }
656 
657  auto const view = toView();
658  RAJA::forall< POLICY >( RAJA::TypedRangeSegment< INDEX_TYPE >( 0, size() ), [view, rhs] LVARRAY_HOST_DEVICE ( INDEX_TYPE const i )
659  {
660  view.data()[ i ] = rhs.data()[ i ];
661  } );
662  }
663 
665 
669 
675  { return m_dataBuffer.getPreviousSpace(); }
676 
681  void registerTouch( MemorySpace const space ) const
682  { m_dataBuffer.registerTouch( space ); }
683 
690  void move( MemorySpace const space, bool const touch=true ) const
691  { m_dataBuffer.moveNested( space, size(), touch ); }
692 
694 
695 #if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__)
696 
701  static int TV_ttf_display_type( ArrayView const * av )
702  {
703  if( av!=nullptr )
704  {
705  int constexpr ndim = NDIM;
706  //std::cout<<"Totalview using ("<<totalview::format<T,INDEX_TYPE>(NDIM, av->m_dims )<<") for display of
707  // m_data;"<<std::endl;
708  // TV_ttf_add_row( "tv(m_data)", totalview::format< T, INDEX_TYPE >( NDIM, av->m_dims ).c_str(), (av->m_data) );
709  // TV_ttf_add_row( "m_data", totalview::format< T, INDEX_TYPE >( 0, av->m_dims ).c_str(), (av->m_data) );
710  TV_ttf_add_row( "m_dims", totalview::format< INDEX_TYPE, int >( 1, &ndim ).c_str(), (av->m_dims) );
711  TV_ttf_add_row( "m_strides", totalview::format< INDEX_TYPE, int >( 1, &ndim ).c_str(), (av->m_strides) );
712  TV_ttf_add_row( "m_dataBuffer", LvArray::system::demangle< BUFFER_TYPE< T > >().c_str(), &(av->m_dataBuffer) );
713  TV_ttf_add_row( "m_singleParameterResizeIndex", "int", &(av->m_singleParameterResizeIndex) );
714  }
715  return 0;
716  }
717 #endif
718 
719 protected:
720 
727  ArrayView( bool ) noexcept:
728  m_dims{ 0 },
729  m_strides{ 0 },
730  m_dataBuffer( true )
731  {
732 #if defined(LVARRAY_USE_TOTALVIEW_OUTPUT) && !defined(__CUDA_ARCH__) && defined(LVARRAY_BOUNDS_CHECK)
733  ArrayView::TV_ttf_display_type( nullptr );
734 #endif
735  }
736 
743  inline LVARRAY_HOST_DEVICE constexpr
744  ArrayView( BUFFER_TYPE< T > && buffer ) noexcept:
745  m_dims{ 0 },
746  m_strides{ 0 },
747  m_dataBuffer{ std::move( buffer ) },
749  {}
750 
753 
756 
758  BUFFER_TYPE< T > m_dataBuffer;
759 
763 };
764 
768 template< class >
769 constexpr bool isArrayView = false;
770 
779 template< typename T,
780  int NDIM,
781  int USD,
782  typename INDEX_TYPE,
783  template< typename > class BUFFER_TYPE >
784 constexpr bool isArrayView< ArrayView< T, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > > = true;
785 
786 } // namespace LvArray
T value_type
The type of the values in the ArrayView, here for stl compatability.
Definition: ArrayView.hpp:107
LVARRAY_HOST_DEVICE constexpr ArraySlice< T const, NDIM, USD, INDEX_TYPE > toSliceConst() const &noexcept
Definition: ArrayView.hpp:327
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE capacity() const
Definition: ArrayView.hpp:440
LVARRAY_HOST_DEVICE constexpr ArrayView(typeManipulation::CArray< INDEX_TYPE, NDIM > const &dims, typeManipulation::CArray< INDEX_TYPE, NDIM > const &strides, int const singleParameterResizeIndex, BUFFER_TYPE< T > const &buffer)
Construct a new ArrayView from existing components.
Definition: ArrayView.hpp:198
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE linearIndex(INDICES const ... indices) const
Definition: ArrayView.hpp:457
constexpr bool isArrayView
True if the template type is a ArrayView.
Definition: ArrayView.hpp:769
INDEX_TYPE size_type
The integer type used for indexing, here for stl compatability.
Definition: ArrayView.hpp:110
This class serves to provide a sliced multidimensional interface to the family of LvArray classes...
Definition: ArraySlice.hpp:89
LVARRAY_HOST_DEVICE constexpr T * data() const
Definition: ArrayView.hpp:569
T & front() const
Definition: ArrayView.hpp:589
#define LVARRAY_ASSERT_GT(lhs, rhs)
Assert that one value compares greater than the other in debug builds.
Definition: Macros.hpp:515
LVARRAY_HOST_DEVICE constexpr ArraySlice< T, NDIM, USD, INDEX_TYPE > toSlice() const &noexcept
Definition: ArrayView.hpp:308
Contains functions for interacting with ArraySlices of arbitrary dimension.
#define LVARRAY_ERROR_IF_NE_MSG(lhs, rhs, msg)
Raise a hard error if two values are not equal.
Definition: Macros.hpp:305
void registerTouch(MemorySpace const space) const
Touch the memory in space.
Definition: ArrayView.hpp:681
~ArrayView()=default
The default destructor.
LVARRAY_HOST_DEVICE constexpr ViewTypeConst toViewConst() const &
Definition: ArrayView.hpp:281
Contains portable access to std::numeric_limits and functions for converting between integral types...
#define ARRAY_SLICE_CHECK_BOUNDS(index)
Point GDB at the scripts/gdb-printers.py.
Definition: ArraySlice.hpp:66
LVARRAY_HOST_DEVICE constexpr T * end() const
Definition: ArrayView.hpp:583
Contains the LvArray umpire interface. This is only used to keep umpire/ResourceManager.hpp out of the includes for most headers.
LVARRAY_HOST_DEVICE constexpr NestedViewTypeConst toNestedViewConst() const &
Definition: ArrayView.hpp:300
This class serves to provide a "view" of a multidimensional array.
Definition: ArrayView.hpp:68
#define CONSTEXPR_WITHOUT_BOUNDS_CHECK
Expands to constexpr when array bound checking is disabled.
Definition: Macros.hpp:609
LVARRAY_HOST_DEVICE LVARRAY_INTEL_CONSTEXPR ArrayView & operator=(ArrayView &&rhs)
Move assignment operator, creates a shallow copy and invalidates the source.
Definition: ArrayView.hpp:231
void zero() const
Use memset to set all the values in the array to 0.
Definition: ArrayView.hpp:629
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE size() const noexcept
Definition: ArrayView.hpp:400
T ValueType
The type of the values in the ArrayView.
Definition: ArrayView.hpp:77
typeManipulation::CArray< INDEX_TYPE, NDIM > m_dims
the dimensions of the array.
Definition: ArrayView.hpp:752
Contains the implementation of LvArray::ArraySlice.
LVARRAY_HOST_DEVICE constexpr ArrayView toView() const &
Definition: ArrayView.hpp:274
LVARRAY_HOST_DEVICE constexpr BUFFER_TYPE< T > const & dataBuffer() const
Definition: ArrayView.hpp:499
ArrayView< std::remove_const_t< T > const, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > ViewTypeConst
The type when the data type is const.
Definition: ArrayView.hpp:89
#define LVARRAY_ASSERT_GE(lhs, rhs)
Assert that one value compares greater than or equal to the other in debug builds.
Definition: Macros.hpp:530
LVARRAY_HOST_DEVICE constexpr ArrayView(ArrayView< U, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > const &source)
Construct a new ArrayView from an ArrayView with a different type.
Definition: ArrayView.hpp:155
Contains functions for manipulating buffers.
BUFFER_TYPE< T > m_dataBuffer
this data member contains the actual data for the array.
Definition: ArrayView.hpp:758
static constexpr int USD
The unit stride dimension.
Definition: ArrayView.hpp:83
T & back() const
Definition: ArrayView.hpp:595
typeManipulation::CArray< INDEX_TYPE, NDIM > m_strides
the strides of the array.
Definition: ArrayView.hpp:755
camp::resources::Platform MemorySpace
an alias for camp::resources::Platform.
Definition: bufferManipulation.hpp:31
DISABLE_HD_WARNING void setValues(T const &value) const
Set all entries in the array to value.
Definition: ArrayView.hpp:613
INDEX_TYPE IndexType
The integer type used for indexing.
Definition: ArrayView.hpp:86
static LVARRAY_HOST_DEVICE constexpr auto multiply(A const a, B const b)
Definition: indexing.hpp:47
LVARRAY_HOST_DEVICE void checkIndices(INDEX_TYPE const *const LVARRAY_RESTRICT dims, INDICES const ... indices)
Check that the indices are with dims , if not the program is aborted.
Definition: indexing.hpp:208
void move(MemorySpace const space, bool const touch=true) const
Move the Array to the given execution space, optionally touching it.
Definition: ArrayView.hpp:690
void setValues(ArrayView< T const, NDIM, USD, INDEX_TYPE, BUFFER_TYPE > const &rhs) const
Set entries to values from another compatible ArrayView.
Definition: ArrayView.hpp:648
LVARRAY_HOST_DEVICE constexpr T & operator()(INDICES... indices) const
Definition: ArrayView.hpp:559
The top level namespace.
Definition: Array.hpp:24
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK INDEX_TYPE size(int const dim) const noexcept
Definition: ArrayView.hpp:420
MemorySpace getPreviousSpace() const
Definition: ArrayView.hpp:674
LVARRAY_HOST_DEVICE constexpr T * begin() const
Definition: ArrayView.hpp:576
LVARRAY_HOST_DEVICE constexpr typeManipulation::CArray< INDEX_TYPE, NDIM > const & dimsArray() const
Definition: ArrayView.hpp:477
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK ArrayView(bool) noexcept
Protected constructor to be used by the Array class.
Definition: ArrayView.hpp:727
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE constexpr ArrayView(ArrayView const &source) noexcept
Copy Constructor.
Definition: ArrayView.hpp:131
Contains a bunch of macro definitions.
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE const * strides() const noexcept
Definition: ArrayView.hpp:484
LVARRAY_HOST_DEVICE constexpr typeManipulation::CArray< INDEX_TYPE, NDIM > const & stridesArray() const
Definition: ArrayView.hpp:491
int m_singleParameterResizeIndex
Definition: ArrayView.hpp:762
T data[N]
The backing c array, public so that aggregate initialization works.
Definition: typeManipulation.hpp:540
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE const * dims() const noexcept
Definition: ArrayView.hpp:470
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE constexpr ArrayView(BUFFER_TYPE< T > &&buffer) noexcept
Protected constructor to be used by the Array class.
Definition: ArrayView.hpp:744
#define DISABLE_HD_WARNING
Disable host device warnings.
Definition: Macros.hpp:561
std::string demangle(char const *const name)
Definition: system.cpp:388
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK std::enable_if_t< _NDIM==1, T &> operator[](INDEX_TYPE const index) const &noexcept
Definition: ArrayView.hpp:546
LVARRAY_HOST_DEVICE constexpr NestedViewType toNestedView() const &
Definition: ArrayView.hpp:293
LVARRAY_HOST_DEVICE constexpr bool empty() const
Definition: ArrayView.hpp:433
static constexpr int NDIM
The number of dimensions.
Definition: ArrayView.hpp:80
Contains functions to aid in multidimensional indexing.
#define LVARRAY_ERROR_IF_NE(lhs, rhs)
Raise a hard error if two values are not equal.
Definition: Macros.hpp:321
ArrayView()=default
A constructor to create an uninitialized ArrayView.
LVARRAY_INTEL_CONSTEXPR ArrayView & operator=(ArrayView const &rhs) noexcept
Copy assignment operator, creates a shallow copy.
Definition: ArrayView.hpp:250
LVARRAY_HOST_DEVICE constexpr int getSingleParameterResizeIndex() const
Definition: ArrayView.hpp:447
#define LVARRAY_HOST_DEVICE
Mark a function for both host and device usage.
Definition: Macros.hpp:549