20 #ifdef LVARRAY_BOUNDS_CHECK 27 #define SORTEDARRAY_CHECK_BOUNDS( index ) \ 28 LVARRAY_ERROR_IF( index < 0 || index >= size(), \ 29 "Array Bounds Check Failed: index=" << index << " size()=" << size()) 31 #else // LVARRAY_BOUNDS_CHECK 38 #define SORTEDARRAY_CHECK_BOUNDS( index ) 40 #endif // LVARRAY_BOUNDS_CHECK 57 template<
typename >
class BUFFER_TYPE >
182 {
return size() == 0; }
275 #if defined(LVARRAY_USE_CUDA) 276 if( space == MemorySpace::cuda ) touch =
false;
278 #if defined(LVARRAY_USE_HIP) 279 if( space == MemorySpace::hip ) touch =
false;
318 template<
typename >
class BUFFER_TYPE >
319 constexpr
bool isSortedArrayView< SortedArrayView< T, INDEX_TYPE, BUFFER_TYPE > > =
true;
LVARRAY_HOST_DEVICE constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > toViewConst() const
Definition: SortedArrayView.hpp:150
SortedArrayView & operator=(SortedArrayView const &src)=default
Default copy assignment operator, this does a shallow copy.
LVARRAY_HOST_DEVICE constexpr SortedArrayView & operator=(SortedArrayView &&src)
Default move assignment operator, this does a shallow copy.
Definition: SortedArrayView.hpp:122
void move(MemorySpace const space, bool touch=true) const
Moves the SortedArrayView to the given execution space.
Definition: SortedArrayView.hpp:273
BUFFER_TYPE< T > m_values
Holds the array of values.
Definition: SortedArrayView.hpp:298
LVARRAY_HOST_DEVICE constexpr SortedArrayView(INDEX_TYPE const size, BUFFER_TYPE< T > const &buffer)
Construct a new SortedArrayView from the given buffer.
Definition: SortedArrayView.hpp:104
This class serves to provide a sliced multidimensional interface to the family of LvArray classes...
Definition: ArraySlice.hpp:89
INDEX_TYPE m_size
The number of values.
Definition: SortedArrayView.hpp:301
#define CONSTEXPR_WITHOUT_BOUNDS_CHECK
Expands to constexpr when array bound checking is disabled.
Definition: Macros.hpp:662
LVARRAY_HOST_DEVICE constexpr SortedArrayView< T const, INDEX_TYPE, BUFFER_TYPE > toView() const
Definition: SortedArrayView.hpp:142
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK T const & operator[](INDEX_TYPE const i) const
Definition: SortedArrayView.hpp:220
Contains the implementation of LvArray::ArraySlice.
INDEX_TYPE size_type
The integer type used for indexing, here for stl compatability.
Definition: SortedArrayView.hpp:72
LVARRAY_HOST_DEVICE bool contains(T const &value) const
Definition: SortedArrayView.hpp:196
SortedArrayView()
Default constructor.
Definition: SortedArrayView.hpp:293
Contains functions for manipulating buffers.
LVARRAY_HOST_DEVICE bool count(T const &value) const
Definition: SortedArrayView.hpp:205
constexpr bool isSortedArrayView
True if the template type is a SortedArrayView.
Definition: SortedArrayView.hpp:308
T value_type
The type of the values contained in the SortedArrayView, here for stl compatability.
Definition: SortedArrayView.hpp:69
LVARRAY_HOST_DEVICE constexpr T const * end() const
Definition: SortedArrayView.hpp:255
camp::resources::Platform MemorySpace
an alias for camp::resources::Platform.
Definition: bufferManipulation.hpp:31
LVARRAY_HOST_DEVICE constexpr T const * data() const
Definition: SortedArrayView.hpp:241
The top level namespace.
Definition: Array.hpp:24
This file contains common sorted array manipulation routines. Aside from the functions that take a ca...
LVARRAY_HOST_DEVICE constexpr ArraySlice< T const, 1, 0, INDEX_TYPE > toSlice() const &
Definition: SortedArrayView.hpp:157
INDEX_TYPE IndexType
The integer type used for indexing.
Definition: SortedArrayView.hpp:66
T ValueType
The type of the values contained in the SortedArrayView.
Definition: SortedArrayView.hpp:63
LVARRAY_HOST_DEVICE constexpr SortedArrayView(SortedArrayView &&src)
Default move constructor, performs a shallow copy.
Definition: SortedArrayView.hpp:91
LVARRAY_HOST_DEVICE constexpr T const * begin() const
Definition: SortedArrayView.hpp:248
LVARRAY_HOST_DEVICE CONSTEXPR_WITHOUT_BOUNDS_CHECK T const & operator()(INDEX_TYPE const i) const
Definition: SortedArrayView.hpp:231
LVARRAY_HOST_DEVICE constexpr bool empty() const
Definition: SortedArrayView.hpp:181
DISABLE_HD_WARNING LVARRAY_HOST_DEVICE bool contains(T const *const LVARRAY_RESTRICT ptr, std::ptrdiff_t const size, T const &value, Compare &&comp=Compare())
Definition: sortedArrayManipulation.hpp:451
This class provides a view into a SortedArray.
Definition: SortedArrayView.hpp:58
#define LVARRAY_HOST_DEVICE
Mark a function for both host and device usage.
Definition: Macros.hpp:600
LVARRAY_HOST_DEVICE constexpr INDEX_TYPE size() const
Definition: SortedArrayView.hpp:188
#define SORTEDARRAY_CHECK_BOUNDS(index)
Check that index falls within the size of the first dimension.
Definition: SortedArrayView.hpp:38