22 m_host_ptr(host_ptr !=
nullptr ? host_ptr : ptr) {}
26 std::enable_if_t<details::is_same_nc<T, OTHERTYPE>::value,
bool> >
29 : m_size(parent.size()),
38 parent.host_ptr()))) {}
42 std::enable_if_t<details::is_same_nc<T, OTHERTYPE>::value,
bool> >
49 m_ptr =
reinterpret_cast<pointer
>(
51 m_host_ptr =
reinterpret_cast<pointer
>(
61 std::enable_if_t<std::is_same<std::remove_cv_t<T>,
62 std::remove_cv_t<OTHERTYPE> >::value,
67 return ((m_size ==
rhs.size()) &&
68 (
static_cast<const void*
>(m_ptr) ==
69 static_cast<const void*
>(
rhs.ptr())) &&
70 (
static_cast<const void*
>(m_host_ptr) ==
71 static_cast<const void*
>(
rhs.host_ptr())));
76 std::enable_if_t<std::is_same<std::remove_cv_t<T>,
77 std::remove_cv_t<OTHERTYPE> >::value,
82 return !(*
this ==
rhs);
114 std::vector<typename vector_view<T>::size_type>
result(data.size());
115 std::transform(data.host_ptr(), data.host_ptr() + data.size(),
117 [](
const auto&
vv) { return vv.capacity(); });
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
A view for jagged vectors.
Definition jagged_vector_view.hpp:45
VECMEM_HOST_AND_DEVICE pointer host_ptr() const
Access the host accessible array describing the inner vectors.
Definition jagged_vector_view.ipp:105
VECMEM_HOST_AND_DEVICE jagged_vector_view & operator=(const jagged_vector_view< OTHERTYPE > &rhs)
Assignment operator from a "slightly different" object.
std::size_t size_type
We cannot use boolean types.
Definition jagged_vector_view.hpp:53
std::add_pointer_t< value_type > pointer
Pointer type to the jagged array.
Definition jagged_vector_view.hpp:57
VECMEM_HOST_AND_DEVICE bool operator!=(const jagged_vector_view< OTHERTYPE > &rhs) const
Inequality check. Simply based on operator==.
Definition jagged_vector_view.ipp:79
jagged_vector_view()=default
Default constructor.
VECMEM_HOST_AND_DEVICE size_type capacity() const
Get the maximum capacity of the "outer" vector.
Definition jagged_vector_view.ipp:92
VECMEM_HOST_AND_DEVICE bool operator==(const jagged_vector_view< OTHERTYPE > &rhs) const
Equality check.
Definition jagged_vector_view.ipp:64
VECMEM_HOST_AND_DEVICE pointer ptr() const
Get a pointer to the vector elements.
Definition jagged_vector_view.ipp:99
VECMEM_HOST_AND_DEVICE size_type size() const
Get the "outer" size of the jagged vector.
Definition jagged_vector_view.ipp:86
VECMEM_HOST std::vector< typename vector_view< T >::size_type > get_capacities(const jagged_vector_view< T > &data)
Get the capacities of the inner vectors of a jagged vector.
Definition jagged_vector_view.ipp:111
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16