11#include "vecmem/containers/data/jagged_vector_buffer.hpp"
12#include "vecmem/containers/data/jagged_vector_view.hpp"
13#include "vecmem/containers/data/vector_buffer.hpp"
14#include "vecmem/containers/data/vector_view.hpp"
15#include "vecmem/containers/vector.hpp"
16#include "vecmem/edm/buffer.hpp"
17#include "vecmem/edm/details/schema_traits.hpp"
18#include "vecmem/edm/host.hpp"
19#include "vecmem/edm/view.hpp"
20#include "vecmem/memory/memory_resource.hpp"
21#include "vecmem/utils/abstract_event.hpp"
22#include "vecmem/utils/async_size.hpp"
23#include "vecmem/utils/async_sizes.hpp"
24#include "vecmem/utils/attributes.hpp"
25#include "vecmem/vecmem_core_export.hpp"
82 template <
typename TYPE>
86 template <
typename TYPE>
91 template <
typename TYPE>
97 template <
typename TYPE>
104 template <
typename TYPE,
typename ALLOC>
107 std::vector<TYPE, ALLOC>& to,
111 template <
typename TYPE>
117 template <
typename TYPE>
128 template <
typename TYPE>
133 template <
typename TYPE>
138 template <
typename TYPE>
145 template <
typename TYPE>
152 template <
typename TYPE,
typename ALLOC1,
typename ALLOC2>
155 std::vector<std::vector<TYPE, ALLOC2>,
ALLOC1>& to,
159 template <
typename TYPE>
160 std::vector<typename data::vector_view<TYPE>::size_type> get_sizes(
164 template <
typename TYPE>
171 template <
typename TYPE>
182 template <
typename SCHEMA>
194 memory_resource& resource,
228 std::vector<data::vector_view<int>::size_type> get_sizes(
241 virtual void do_copy(std::size_t size,
const void*
from,
void* to,
244 virtual void do_memset(std::size_t size,
void* ptr,
int value)
const;
246 VECMEM_NODISCARD
virtual event_type create_event()
const;
250 template <
typename TYPE>
255 template <
typename TYPE>
260 template <
typename TYPE>
261 void copy_views_impl(
266 template <
typename TYPE>
267 void copy_views_contiguous_impl(
272 template <
typename TYPE>
288 void copy_sizes_impl(
294 void copy_payload_impl(
300 std::vector<data::vector_view<int>::size_type> get_sizes_impl(
313#include "vecmem/utils/impl/copy.ipp"
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
Return type for asynchronous size retrievals.
Definition async_size.hpp:25
Class implementing (synchronous) host <-> device memory copies.
Definition copy.hpp:45
VECMEM_NODISCARD event_type setup(data::jagged_vector_view< TYPE > data) const
Copy the internal state of a jagged vector buffer to the target device.
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.
VECMEM_NODISCARD event_type operator()(const edm::view< edm::details::add_const_t< edm::schema< VARTYPES... > > > &from, edm::host< edm::schema< VARTYPES... >, INTERFACE > &to, type::copy_type cptype=type::unknown) const
Copy from a view, into a host container.
VECMEM_NODISCARD event_type operator()(const data::jagged_vector_view< std::add_const_t< TYPE > > &from, std::vector< std::vector< TYPE, ALLOC2 >, ALLOC1 > &to, type::copy_type cptype=type::unknown) const
Copy a jagged vector's data into a vector object.
VECMEM_NODISCARD event_type operator()(const data::vector_view< std::add_const_t< TYPE > > &from, std::vector< TYPE, ALLOC > &to, type::copy_type cptype=type::unknown) const
Copy a 1-dimensional vector's data into a vector object.
VECMEM_NODISCARD async_size< typename edm::view< edm::schema< VARTYPES... > >::size_type > get_size(const edm::view< edm::schema< VARTYPES... > > &data, memory_resource &pinnedHostMr) const
Get the (outer) size of a (resizable) SoA container asynchronously.
std::unique_ptr< abstract_event > event_type
Event type used by the copy class.
Definition copy.hpp:73
VECMEM_NODISCARD event_type memset(edm::view< edm::schema< VARTYPES... > > data, int value) const
Set all bytes of the container to some value.
VECMEM_NODISCARD event_type operator()(const edm::view< edm::details::add_const_t< edm::schema< VARTYPES... > > > &from, edm::view< edm::schema< VARTYPES... > > to, type::copy_type cptype=type::unknown) const
Copy between two views.
VECMEM_NODISCARD event_type memset(data::jagged_vector_view< TYPE > data, int value) const
Set all bytes of the jagged vector to some value.
VECMEM_NODISCARD event_type operator()(const data::jagged_vector_view< std::add_const_t< TYPE > > &from, data::jagged_vector_view< TYPE > to, type::copy_type cptype=type::unknown) const
Copy a jagged vector's data between two existing allocations.
VECMEM_NODISCARD async_sizes< data::vector_view< int >::size_type > get_sizes(const edm::view< edm::schema< VARTYPES... > > &data, memory_resource &pinnedHostMr) const
Get the (inner) size of a (resizable) SoA container asynchronously.
VECMEM_NODISCARD async_sizes< typename data::vector_view< TYPE >::size_type > get_sizes(const data::jagged_vector_view< TYPE > &data, memory_resource &pinnedHostMr) const
Helper function for getting the sizes of a resizable jagged vector asynchronously.
VECMEM_NODISCARD async_size< typename data::vector_view< TYPE >::size_type > get_size(const data::vector_view< TYPE > &data, memory_resource &pinnedHostMr) const
Helper function for getting the size of a resizable 1D buffer asynchonously.
VECMEM_NODISCARD event_type setup(edm::view< SCHEMA > data) const
Set up the internal state of a buffer correctly on a device.
VECMEM_NODISCARD event_type memset(data::vector_view< TYPE > data, int value) const
Set all bytes of the vector to some value.
virtual ~copy()=default
Virtual destructor.
Object owning all the data of a jagged vector.
Definition jagged_vector_buffer.hpp:30
A view for jagged vectors.
Definition jagged_vector_view.hpp:45
Object owning the data held by it.
Definition vector_buffer.hpp:29
Class holding data about a 1 dimensional vector/array.
Definition vector_view.hpp:38
Technical base type for buffer<schema<VARTYPES...>>
Definition buffer.hpp:28
Technical base type for host<schema<VARTYPES...>,INTERFACE>
Definition host.hpp:28
Technical base type for view<schema<VARTYPES...>>
Definition view.hpp:29
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
Wrapper struct around the copy_type enumeration.
Definition copy.hpp:54
copy_type
Types of memory copies to handle.
Definition copy.hpp:56
Meta type describing the "schema" of an SoA container.
Definition schema.hpp:46