15template <
typename TYPE>
17 memory_resource* resource) {
20 const std::size_t size =
vec.
size();
25 (resource !=
nullptr ? *resource : *(
vec.get_allocator().resource())));
29 typedef typename value_type::size_type size_type;
32 for (std::size_t
i = 0;
i < size; ++
i) {
34 value_type(
static_cast<size_type
>(
vec[
i].size()),
vec[
i].data());
41template <
typename TYPE,
typename ALLOC1,
typename ALLOC2>
43 std::vector<std::vector<TYPE, ALLOC1>,
ALLOC2>&
vec,
44 memory_resource* resource) {
47 assert(resource !=
nullptr);
50 const std::size_t size =
vec.size();
57 typedef typename value_type::size_type size_type;
60 for (std::size_t
i = 0;
i < size; ++
i) {
62 value_type(
static_cast<size_type
>(
vec[
i].size()),
vec[
i].data());
69template <
typename TYPE>
71 memory_resource* resource) {
74 const std::size_t size =
vec.
size();
79 (resource !=
nullptr ? *resource : *(
vec.get_allocator().resource())));
84 typedef typename value_type::size_type size_type;
87 for (std::size_t
i = 0;
i < size; ++
i) {
89 value_type(
static_cast<size_type
>(
vec[
i].size()),
vec[
i].data());
96template <
typename TYPE,
typename ALLOC1,
typename ALLOC2>
98 const std::vector<std::vector<TYPE, ALLOC1>,
ALLOC2>&
vec,
99 memory_resource* resource) {
102 assert(resource !=
nullptr);
105 const std::size_t size =
vec.size();
113 typedef typename value_type::size_type size_type;
116 for (std::size_t
i = 0;
i < size; ++
i) {
118 value_type(
static_cast<size_type
>(
vec[
i].size()),
vec[
i].data());
A data wrapper for jagged vectors.
Definition jagged_vector_data.hpp:30
typename base_type::value_type value_type
Use the base class's value_type.
Definition jagged_vector_data.hpp:38
VECMEM_HOST_AND_DEVICE size_type size() const
Get the "outer" size of the jagged vector.
Definition jagged_vector_view.ipp:83
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
std::vector< T, vecmem::polymorphic_allocator< T > > vector
Alias type for vectors with our polymorphic allocator.
Definition vector.hpp:35
VECMEM_HOST data::vector_view< T > get_data(array< T, N > &a)
Helper function creating a vecmem::data::vector_view object.
Definition array.ipp:217