11#include "vecmem/containers/details/resize_jagged_vector.hpp"
12#include "vecmem/containers/jagged_vector.hpp"
13#include "vecmem/edm/details/schema_traits.hpp"
14#include "vecmem/memory/get_default_resource.hpp"
15#include "vecmem/utils/debug.hpp"
16#include "vecmem/utils/type_traits.hpp"
28template <
typename TYPE>
32 if ((data.size_ptr() ==
nullptr) || (data.capacity() == 0)) {
40 "Prepared a device vector buffer of capacity %u "
41 "for use on a device (ptr: %p)",
42 data.capacity(),
static_cast<void*
>(data.size_ptr()));
48template <
typename TYPE>
52 if (data.capacity() == 0) {
57 do_memset(data.capacity() *
sizeof(TYPE), data.ptr(), value);
58 VECMEM_DEBUG_MSG(2,
"Set %u vector elements to %i at ptr: %p",
59 data.capacity(), value,
static_cast<void*
>(data.ptr()));
65template <
typename TYPE>
83template <
typename TYPE>
97template <
typename TYPE,
typename ALLOC>
99 const data::vector_view<std::add_const_t<TYPE>>& from_view,
100 std::vector<TYPE, ALLOC>& to_vec, type::copy_type cptype)
const {
103 const typename data::vector_view<std::add_const_t<TYPE>>::size_type size =
114 do_copy(size *
sizeof(TYPE), from_view.ptr(), to_vec.data(), cptype);
120template <
typename TYPE>
144template <
typename TYPE>
160 auto value = make_unique_alloc<value_type>(pinnedHostMr);
169template <
typename TYPE>
173 if (data.size() == 0) {
179 if (data.host_ptr()[0].size_ptr() !=
nullptr) {
182 data.host_ptr()[0].size_ptr(), 0);
186 if (data.ptr() == data.host_ptr()) {
197 "Prepared a jagged device vector buffer of size %lu "
198 "for use on a device",
205template <
typename TYPE>
210 if (is_contiguous(data.host_ptr(), data.capacity())) {
214 const std::size_t total_size = std::accumulate(
215 data.host_ptr(), data.host_ptr() + data.size(),
216 static_cast<std::size_t
>(0u),
217 [](std::size_t sum,
const data::vector_view<TYPE>& iv) {
218 return sum + iv.capacity();
221 for (std::size_t i = 0; i < data.size(); ++i) {
222 data::vector_view<TYPE>& iv = data.host_ptr()[i];
223 if ((iv.capacity() != 0u) && (iv.ptr() !=
nullptr)) {
225 do_memset(total_size *
sizeof(TYPE), iv.ptr(), value);
235 for (std::size_t i = 0; i < data.size(); ++i) {
236 data::vector_view<TYPE>& iv = data.host_ptr()[i];
237 do_memset(iv.capacity() *
sizeof(TYPE), iv.ptr(), value);
245template <
typename TYPE>
272template <
typename TYPE>
286template <
typename TYPE,
typename ALLOC1,
typename ALLOC2>
288 const data::jagged_vector_view<std::add_const_t<TYPE>>& from_view,
289 std::vector<std::vector<TYPE, ALLOC2>, ALLOC1>& to_vec,
290 type::copy_type cptype)
const {
295 assert(sizes.size() == to_vec.size());
296 for (
typename data::jagged_vector_view<std::add_const_t<TYPE>>::size_type
298 i < from_view.size(); ++i) {
299 to_vec[i].resize(sizes[i]);
306template <
typename TYPE>
311 std::vector<typename data::vector_view<TYPE>::size_type>
result(data.
size(),
315 for (std::size_t
i = 0;
i < data.
size(); ++
i) {
318 if ((data.
host_ptr()[
i].capacity() != 0) &&
319 (data.
host_ptr()[
i].size_ptr() !=
nullptr)) {
337 for (std::size_t
i = 0;
i < data.
size(); ++
i) {
343template <
typename TYPE>
349 if ((
sizes.size() == 0) && (data.
size() == 0)) {
353 if (sizes.size() != data.
size()) {
354 std::ostringstream msg;
355 msg <<
"sizes.size() (" << sizes.size() <<
") != data.size() ("
356 << data.
size() <<
")";
357 throw std::length_error(msg.str());
361 bool perform_copy =
true;
363 i < data.
size(); ++i) {
366 if (data.
host_ptr()[i].capacity() < sizes[i]) {
367 std::ostringstream msg;
368 msg <<
"data.host_ptr()[" << i <<
"].capacity() ("
369 << data.
host_ptr()[i].capacity() <<
") < sizes[" << i <<
"] ("
371 throw std::length_error(msg.str());
375 if (data.
host_ptr()[i].size_ptr() ==
nullptr) {
376 perform_copy =
false;
377 }
else if (perform_copy ==
false) {
378 throw std::invalid_argument(
379 "Inconsistent target jagged vector view received for resizing");
383 if (perform_copy ==
false) {
395template <
typename TYPE>
396async_sizes<typename data::vector_view<TYPE>::size_type>
copy::get_sizes(
397 const data::jagged_vector_view<TYPE>& data,
398 memory_resource& pinnedHostMr)
const {
401 for (std::size_t i = 0; i < data.size(); ++i) {
404 if ((data.host_ptr()[i].capacity() != 0) &&
405 (data.host_ptr()[i].size_ptr() !=
nullptr)) {
408 vector<typename data::vector_view<TYPE>::size_type> result(
409 data.size(), 0, &pinnedHostMr);
414 data.host_ptr()[i].size_ptr(), result.data() + i,
423 vector<typename data::vector_view<TYPE>::size_type> result(data.size(), 0);
424 for (std::size_t i = 0; i < data.size(); ++i) {
425 result[i] = data.host_ptr()[i].capacity();
430template <
typename SCHEMA>
434 if (data.layout().ptr() != data.host_layout().ptr()) {
435 assert(data.layout().capacity() > 0u);
436 [[maybe_unused]]
bool did_copy =
437 copy_view_impl(data.host_layout(), data.layout(),
type::unknown);
442 if (data.size().ptr() !=
nullptr) {
443 assert(data.size().capacity() > 0u);
444 do_memset(data.size().capacity() *
sizeof(
char), data.size().ptr(), 0);
447 "Prepared an SoA container of capacity %u "
448 "for use on a device (layout: {%u, %p}, size: {%u, %p})",
449 data.capacity(), data.layout().size(),
450 static_cast<void*
>(data.layout().ptr()),
451 data.size().size(),
static_cast<void*
>(data.size().ptr()));
457template <
typename... VARTYPES>
462 if (data.payload().ptr() !=
nullptr) {
463 memset(data.payload(), value);
466 memset_impl<0>(data, value);
473template <
typename... VARTYPES>
526 if ((
from_view.payload().ptr() !=
nullptr) &&
527 (
to_view.payload().ptr() !=
nullptr) &&
531 if (
from_view.payload().capacity() == 0) {
536 VECMEM_DEBUG_MSG(2,
"Performing simple SoA copy of %u bytes",
537 from_view.payload().size());
540 copy_view_impl(from_view.payload(), to_view.payload(), cptype);
543 if (to_view.
size().ptr() !=
nullptr) {
545 if (from_view.size().ptr() !=
nullptr) {
547 if (from_view.size().capacity() != to_view.
size().capacity()) {
548 std::ostringstream msg;
549 msg <<
"from_view.size().capacity() ("
550 << from_view.size().capacity()
551 <<
") != to_view.size().capacity() ("
552 << to_view.
size().capacity() <<
")";
553 throw std::length_error(msg.str());
556 copy_view_impl(from_view.size(), to_view.
size(), cptype);
559 copy_sizes_impl<0>(from_view, to_view, cptype);
568 copy_payload_impl<0>(from_view, to_view, cptype);
574template <
typename... VARTYPES,
template <
typename>
class INTERFACE>
576 const edm::view<edm::details::add_const_t<edm::schema<VARTYPES...>>>&
578 edm::host<edm::schema<VARTYPES...>, INTERFACE>& to_vec,
579 type::copy_type cptype)
const {
582 resize_impl<0>(from_view, to_vec, cptype);
588template <
typename... VARTYPES>
596 value_type size = data.capacity();
601 if constexpr (std::disjunction_v<
607 if (data.size().ptr() ==
nullptr) {
612 assert(data.size().size() ==
sizeof(value_type));
638 if constexpr (std::disjunction_v<
642 *value = data.capacity();
647 if (data.size().ptr() ==
nullptr) {
650 make_unique_alloc<value_type>(*(get_default_resource()));
651 *value = data.capacity();
656 assert(data.size().size() ==
sizeof(value_type));
659 auto value = make_unique_alloc<value_type>(pinnedHostMr);
662 do_copy(
sizeof(value_type), data.size().ptr(), value.get(),
670template <
typename... VARTYPES>
677 "Function can only be used on containers with jagged vectors");
692template <
typename TYPE>
693bool copy::copy_view_impl(
694 const data::vector_view<std::add_const_t<TYPE>>& from_view,
695 data::vector_view<TYPE> to_view, type::copy_type cptype)
const {
698 const typename data::vector_view<std::add_const_t<TYPE>>::size_type size =
706 if (to_view.capacity() < size) {
707 std::ostringstream msg;
708 msg <<
"Target capacity (" << to_view.capacity() <<
") < source size ("
710 throw std::length_error(msg.str());
715 if (to_view.size_ptr() !=
nullptr) {
734 to_view.size_ptr(), size_cptype);
742 do_copy(size *
sizeof(TYPE), from_view.ptr(), to_view.ptr(), cptype);
746template <
typename TYPE>
747bool copy::copy_view_impl(
748 const data::jagged_vector_view<std::add_const_t<TYPE>>& from_view,
749 data::jagged_vector_view<TYPE> to_view, type::copy_type cptype)
const {
752 if (from_view.size() > to_view.size()) {
753 std::ostringstream msg;
754 msg <<
"from_view.size() (" << from_view.size()
755 <<
") > to_view.size() (" << to_view.size() <<
")";
756 throw std::length_error(msg.str());
760 const typename data::jagged_vector_view<std::add_const_t<TYPE>>::size_type
761 size = from_view.size();
767 const bool from_is_contiguous = is_contiguous(from_view.host_ptr(), size);
768 const bool to_is_contiguous = is_contiguous(to_view.host_ptr(), size);
769 VECMEM_DEBUG_MSG(3,
"from_is_contiguous = %d, to_is_contiguous = %d",
770 from_is_contiguous, to_is_contiguous);
779 auto set_sizes_event =
set_sizes(sizes, to_view);
783 std::vector<typename data::vector_view<std::add_const_t<TYPE>>::size_type>
785 bool capacities_match =
true;
786 for (std::size_t i = 0; i < size; ++i) {
787 if (from_view.host_ptr()[i].capacity() !=
788 to_view.host_ptr()[i].capacity()) {
789 capacities_match =
false;
792 capacities[i] = from_view.host_ptr()[i].capacity();
796 if (from_is_contiguous && to_is_contiguous && capacities_match) {
798 copy_views_contiguous_impl(capacities, from_view.host_ptr(),
799 to_view.host_ptr(), cptype);
804 copy_views_impl(sizes, from_view.host_ptr(), to_view.host_ptr(),
810 set_sizes_event->wait();
814template <
typename TYPE>
815void copy::copy_views_impl(
817 const data::vector_view<std::add_const_t<TYPE>>* from_view,
818 data::vector_view<TYPE>* to_view, type::copy_type cptype)
const {
821 assert(from_view !=
nullptr);
822 assert(to_view !=
nullptr);
825 const std::size_t size = sizes.size();
826 [[maybe_unused]] std::size_t copy_ops = 0;
829 for (std::size_t i = 0; i < size; ++i) {
837 assert(from_view[i].ptr() !=
nullptr);
838 assert(to_view[i].ptr() !=
nullptr);
839 assert(sizes[i] <= from_view[i].capacity());
840 assert(sizes[i] <= to_view[i].capacity());
843 do_copy(sizes[i] *
sizeof(TYPE), from_view[i].ptr(), to_view[i].ptr(),
850 "Copied the payload of a jagged vector of type "
851 "\"%s\" with %lu copy operation(s)",
852 typeid(TYPE).name(), copy_ops);
855template <
typename TYPE>
856void copy::copy_views_contiguous_impl(
858 const data::vector_view<std::add_const_t<TYPE>>* from_view,
859 data::vector_view<TYPE>* to_view, type::copy_type cptype)
const {
862 assert(from_view !=
nullptr);
863 assert(to_view !=
nullptr);
864 assert(is_contiguous(from_view, sizes.size()));
865 assert(is_contiguous(to_view, sizes.size()));
868 const std::size_t size = sizes.size();
869 const std::size_t total_size =
870 std::accumulate(sizes.begin(), sizes.end(),
871 static_cast<std::size_t
>(0)) *
875 for (std::size_t i = 0; i < size; ++i) {
883 assert(from_view[i].ptr() !=
nullptr);
884 assert(to_view[i].ptr() !=
nullptr);
887 do_copy(total_size, from_view[i].ptr(), to_view[i].ptr(), cptype);
893 "Copied the payload of a jagged vector of type "
894 "\"%s\" with 1 copy operation(s)",
895 typeid(TYPE).name());
898template <
typename TYPE>
899bool copy::is_contiguous(
const data::vector_view<TYPE>* data,
906 auto ptr = data[0].ptr();
907 for (std::size_t i = 1; i < size; ++i) {
908 if ((ptr + data[i - 1].capacity()) != data[i].ptr()) {
916template <std::size_t INDEX,
typename... VARTYPES>
917void copy::memset_impl(edm::view<edm::schema<VARTYPES...>> data,
921 if constexpr (edm::type::details::is_scalar<
typename std::tuple_element<
922 INDEX, std::tuple<VARTYPES...>>::type>::value) {
923 do_memset(
sizeof(
typename std::tuple_element<
924 INDEX, std::tuple<VARTYPES...>>::type::type),
925 data.template get<INDEX>(), value);
928 memset(data.template get<INDEX>(), value);
931 if constexpr (
sizeof...(VARTYPES) > (INDEX + 1)) {
932 memset_impl<INDEX + 1>(data, value);
936template <std::size_t INDEX,
typename... VARTYPES,
937 template <
typename>
class INTERFACE>
938void copy::resize_impl(
939 const edm::view<edm::details::add_const_t<edm::schema<VARTYPES...>>>&
941 edm::host<edm::schema<VARTYPES...>, INTERFACE>& to_vec,
942 [[maybe_unused]] type::copy_type cptype)
const {
950 if constexpr (std::disjunction_v<
951 edm::type::details::is_jagged_vector<VARTYPES>...> ==
955 edm::details::add_const_t<edm::schema<VARTYPES...>>>::size_type
956 size = from_view.capacity();
958 if (from_view.size().ptr() !=
nullptr) {
960 assert(from_view.size().size() ==
961 sizeof(
typename edm::view<edm::details::add_const_t<
962 edm::schema<VARTYPES...>>>::size_type));
964 do_copy(
sizeof(
typename edm::view<edm::details::add_const_t<
965 edm::schema<VARTYPES...>>>::size_type),
966 from_view.size().ptr(), &size, cptype);
974 VECMEM_DEBUG_MSG(4,
"Resizing a (non-jagged) container to size %u",
981 if constexpr (edm::type::details::is_jagged_vector<
982 typename std::tuple_element<
983 INDEX, std::tuple<VARTYPES...>>::type>::value) {
985 auto sizes =
get_sizes(from_view.template get<INDEX>());
988 4,
"Resizing jagged vector variable at index %lu to size %lu",
989 INDEX, sizes.size());
993 for (std::size_t i = 0; i < sizes.size(); ++i) {
994 to_vec.template get<INDEX>()[i].resize(sizes[i]);
996 }
else if constexpr (edm::type::details::is_vector<
997 typename std::tuple_element<
999 std::tuple<VARTYPES...>>::type>::value) {
1001 auto size =
get_size(from_view.template get<INDEX>());
1004 "Resizing vector variable at index %lu to size %u",
1006 to_vec.template get<INDEX>().resize(size);
1009 if constexpr (
sizeof...(VARTYPES) > (INDEX + 1)) {
1010 resize_impl<INDEX + 1>(from_view, to_vec, cptype);
1015template <std::size_t INDEX,
typename... VARTYPES>
1016void copy::copy_sizes_impl(
1017 [[maybe_unused]]
const edm::view<
1018 edm::details::add_const_t<edm::schema<VARTYPES...>>>& from_view,
1019 [[maybe_unused]] edm::view<edm::schema<VARTYPES...>> to_view,
1020 [[maybe_unused]] type::copy_type cptype)
const {
1024 assert(to_view.size().ptr() !=
nullptr);
1025 assert(from_view.size().ptr() ==
nullptr);
1028 if constexpr (std::disjunction_v<
1029 edm::type::details::is_jagged_vector<VARTYPES>...> ==
1033 edm::details::add_const_t<edm::schema<VARTYPES...>>>::size_type
1034 size = from_view.capacity();
1050 do_copy(
sizeof(
typename edm::view<edm::details::add_const_t<
1051 edm::schema<VARTYPES...>>>::size_type),
1052 &size, to_view.size().ptr(), size_cptype);
1061 if constexpr (edm::type::details::is_jagged_vector<
1062 typename std::tuple_element<
1063 INDEX, std::tuple<VARTYPES...>>::type>::value) {
1065 const auto sizes =
get_sizes(from_view.template get<INDEX>());
1066 set_sizes(sizes, to_view.template get<INDEX>())->wait();
1069 if constexpr (
sizeof...(VARTYPES) > (INDEX + 1)) {
1070 copy_sizes_impl<INDEX + 1>(from_view, to_view, cptype);
1075template <std::size_t INDEX,
typename... VARTYPES>
1076void copy::copy_payload_impl(
1077 const edm::view<edm::details::add_const_t<edm::schema<VARTYPES...>>>&
1079 edm::view<edm::schema<VARTYPES...>> to_view, type::copy_type cptype)
const {
1082 if constexpr (edm::type::details::is_scalar<
typename std::tuple_element<
1083 INDEX, std::tuple<VARTYPES...>>::type>::value) {
1084 do_copy(
sizeof(
typename std::tuple_element<
1085 INDEX, std::tuple<VARTYPES...>>::type::type),
1086 from_view.template get<INDEX>(), to_view.template get<INDEX>(),
1090 copy_view_impl(from_view.template get<INDEX>(),
1091 to_view.template get<INDEX>(), cptype);
1094 if constexpr (
sizeof...(VARTYPES) > (INDEX + 1)) {
1095 copy_payload_impl<INDEX + 1>(from_view, to_view, cptype);
1099template <std::size_t INDEX,
typename... VARTYPES>
1100std::vector<data::vector_view<int>::size_type> copy::get_sizes_impl(
1101 const edm::view<edm::schema<VARTYPES...>>& view)
const {
1105 edm::details::has_jagged_vector<edm::schema<VARTYPES...>>::value,
1106 "Function can only be used on containers with jagged vectors");
1109 if constexpr (edm::type::details::is_jagged_vector<
1110 typename std::tuple_element<
1111 INDEX, std::tuple<VARTYPES...>>::type>::value) {
1113 return get_sizes(view.template get<INDEX>());
1114 }
else if constexpr (
sizeof...(VARTYPES) > (INDEX + 1)) {
1117 return get_sizes_impl<INDEX + 1>(view);
1121#if defined(__GNUC__)
1122 __builtin_unreachable();
1123#elif defined(_MSC_VER)
1128template <std::size_t INDEX,
typename... VARTYPES>
1129async_sizes<data::vector_view<int>::size_type> copy::get_sizes_impl(
1130 const edm::view<edm::schema<VARTYPES...>>& view,
1131 memory_resource& pinnedHostMr)
const {
1135 edm::details::has_jagged_vector<edm::schema<VARTYPES...>>::value,
1136 "Function can only be used on containers with jagged vectors");
1139 if constexpr (edm::type::details::is_jagged_vector<
1140 typename std::tuple_element<
1141 INDEX, std::tuple<VARTYPES...>>::type>::value) {
1143 return get_sizes(view.template get<INDEX>(), pinnedHostMr);
1144 }
else if constexpr (
sizeof...(VARTYPES) > (INDEX + 1)) {
1147 return get_sizes_impl<INDEX + 1>(view, pinnedHostMr);
1151#if defined(__GNUC__)
1152 __builtin_unreachable();
1153#elif defined(_MSC_VER)
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
Return type for asynchronous size retrievals.
Definition async_size.hpp:25
VECMEM_NODISCARD event_type set_sizes(const std::vector< typename data::vector_view< TYPE >::size_type > &sizes, data::jagged_vector_view< TYPE > data) const
Helper function for setting the sizes of a resizable jagged vector.
VECMEM_NODISCARD event_type operator()(const data::vector_view< std::add_const_t< TYPE > > &from, data::vector_view< TYPE > to, type::copy_type cptype=type::unknown) const
Copy a 1-dimensional vector's data between two existing memory blocks.
VECMEM_NODISCARD event_type setup(data::vector_view< TYPE > data) const
Set up the internal state of a vector buffer correctly on a device.
virtual void do_copy(std::size_t size, const void *from, void *to, type::copy_type cptype) const
Perform a "low level" memory copy.
Definition copy.cpp:31
std::unique_ptr< abstract_event > event_type
Event type used by the copy class.
Definition copy.hpp:73
data::vector_view< TYPE >::size_type get_size(const data::vector_view< TYPE > &data) const
Helper function for getting the size of a resizable 1D buffer.
Definition copy.ipp:121
virtual void do_memset(std::size_t size, void *ptr, int value) const
Perform a "low level" memory filling operation.
Definition copy.cpp:44
virtual VECMEM_NODISCARD event_type create_event() const
Create an event for synchronization.
Definition copy.cpp:54
std::vector< typename data::vector_view< TYPE >::size_type > get_sizes(const data::jagged_vector_view< TYPE > &data) const
Helper function for getting the sizes of a resizable jagged vector.
Definition copy.ipp:307
VECMEM_NODISCARD event_type memset(data::vector_view< TYPE > data, int value) const
Set all bytes of the vector to some value.
data::vector_buffer< std::remove_cv_t< TYPE > > to(const data::vector_view< TYPE > &data, memory_resource &resource, type::copy_type cptype=type::unknown) const
Copy a 1-dimensional vector to the specified memory resource.
Definition copy.ipp:66
Object owning all the data of a jagged vector.
Definition jagged_vector_buffer.hpp:30
typename base_type::value_type value_type
Use the base class's value_type.
Definition jagged_vector_buffer.hpp:38
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
std::size_t size_type
We cannot use boolean types.
Definition jagged_vector_view.hpp:53
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 size_type size() const
Get the "outer" size of the jagged vector.
Definition jagged_vector_view.ipp:86
Object owning the data held by it.
Definition vector_buffer.hpp:29
typename base_type::size_type size_type
Size type definition coming from the base class.
Definition vector_buffer.hpp:35
Class holding data about a 1 dimensional vector/array.
Definition vector_view.hpp:38
unsigned int size_type
We cannot use boolean types.
Definition vector_view.hpp:47
VECMEM_HOST_AND_DEVICE size_pointer size_ptr() const
Get a pointer to the size of the vector.
Definition vector_view.ipp:84
VECMEM_HOST_AND_DEVICE size_type capacity() const
Get the maximum capacity of the vector.
Definition vector_view.ipp:78
Technical base type for buffer<schema<VARTYPES...>>
Definition buffer.hpp:28
Technical base type for view<schema<VARTYPES...>>
Definition view.hpp:29
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
buffer_type
"Overall type" for a buffer object
Definition buffer_type.hpp:13
@ fixed_size
The buffer has a fixed number of elements.
@ resizable
The buffer is resizable/expandable.
void resize_jagged_vector(std::vector< std::vector< T, ALLOC1 >, ALLOC2 > &vec, std::size_t size)
Resize a generic jagged vector.
Definition resize_jagged_vector.hpp:23
VECMEM_HOST std::vector< vecmem::data::vector_view< int >::size_type > get_capacities(const view< schema< VARTYPES... > > &soa)
Helper function to get the capacities of the jagged vectors in a view.
Definition view.ipp:198
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
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
copy_type
Types of memory copies to handle.
Definition copy.hpp:56
@ device_to_host
Copy operation between a device and the host.
Definition copy.hpp:60
@ device_to_device
Copy operation between two devices.
Definition copy.hpp:64
@ unknown
Unknown copy type, determined at runtime.
Definition copy.hpp:66
@ host_to_host
Copy operation on the host.
Definition copy.hpp:62
@ host_to_device
Copy operation between the host and a device.
Definition copy.hpp:58
Technical base type for has_jagged_vector<schema<VARTYPES...>>
Definition schema_traits.hpp:238
Meta type describing the "schema" of an SoA container.
Definition schema.hpp:46
Definition schema_traits.hpp:108