vecmem 1.18.0
|
Specialisation of vecmem::copy
for HIP.
More...
#include <vecmem/utils/hip/async_copy.hpp>
Public Types | |
using | event_type = std::unique_ptr< abstract_event > |
Event type used by the copy class. | |
Public Member Functions | |
VECMEM_HIP_EXPORT | async_copy (const stream_wrapper &stream) |
Constructor with the stream to operate on. | |
VECMEM_HIP_EXPORT | ~async_copy () noexcept |
Destructor. | |
template<typename TYPE > | |
copy::event_type | setup (data::vector_view< TYPE > data) const |
template<typename TYPE > | |
copy::event_type | setup (data::jagged_vector_view< TYPE > data) const |
template<typename SCHEMA > | |
copy::event_type | setup (edm::view< SCHEMA > data) const |
template<typename TYPE > | |
copy::event_type | memset (data::vector_view< TYPE > data, int value) const |
template<typename TYPE > | |
copy::event_type | memset (data::jagged_vector_view< TYPE > data, int value) const |
template<typename... VARTYPES> | |
copy::event_type | memset (edm::view< edm::schema< VARTYPES... > > data, int value) const |
template<typename TYPE > | |
copy::event_type | operator() (const data::vector_view< std::add_const_t< TYPE > > &from_view, data::vector_view< TYPE > to_view, type::copy_type cptype) const |
template<typename TYPE , typename ALLOC > | |
copy::event_type | operator() (const data::vector_view< std::add_const_t< TYPE > > &from_view, std::vector< TYPE, ALLOC > &to_vec, type::copy_type cptype) const |
template<typename TYPE > | |
copy::event_type | operator() (const data::jagged_vector_view< std::add_const_t< TYPE > > &from_view, data::jagged_vector_view< TYPE > to_view, type::copy_type cptype) const |
template<typename TYPE , typename ALLOC1 , typename ALLOC2 > | |
copy::event_type | operator() (const data::jagged_vector_view< std::add_const_t< TYPE > > &from_view, std::vector< std::vector< TYPE, ALLOC2 >, ALLOC1 > &to_vec, type::copy_type cptype) const |
template<typename... VARTYPES> | |
copy::event_type | operator() (const edm::view< edm::details::add_const_t< edm::schema< VARTYPES... > > > &from_view, edm::view< edm::schema< VARTYPES... > > to_view, type::copy_type cptype) const |
template<typename... VARTYPES, template< typename > class INTERFACE> | |
copy::event_type | operator() (const edm::view< edm::details::add_const_t< edm::schema< VARTYPES... > > > &from_view, edm::host< edm::schema< VARTYPES... >, INTERFACE > &to_vec, type::copy_type cptype) const |
template<typename TYPE > | |
copy::event_type | set_sizes (const std::vector< typename data::vector_view< TYPE >::size_type > &sizes, data::jagged_vector_view< TYPE > data) const |
1-dimensional vector data handling functions | |
template<typename TYPE > | |
VECMEM_NODISCARD event_type | setup (data::vector_view< TYPE > data) const |
Set up the internal state of a vector buffer correctly on a device. | |
template<typename TYPE > | |
VECMEM_NODISCARD event_type | memset (data::vector_view< TYPE > data, int value) const |
Set all bytes of the vector to some value. | |
template<typename TYPE > | |
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. | |
template<typename TYPE > | |
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. | |
template<typename TYPE , typename ALLOC > | |
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. | |
template<typename TYPE > | |
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. | |
Jagged vector data handling functions | |
template<typename TYPE > | |
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. | |
template<typename TYPE > | |
VECMEM_NODISCARD event_type | memset (data::jagged_vector_view< TYPE > data, int value) const |
Set all bytes of the jagged vector to some value. | |
template<typename TYPE > | |
data::jagged_vector_buffer< std::remove_cv_t< TYPE > > | to (const data::jagged_vector_view< TYPE > &data, memory_resource &resource, memory_resource *host_access_resource=nullptr, type::copy_type cptype=type::unknown) const |
Copy a jagged vector to the specified memory resource. | |
template<typename TYPE > | |
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. | |
template<typename TYPE , typename ALLOC1 , typename ALLOC2 > | |
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. | |
template<typename TYPE > | |
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. | |
template<typename TYPE > | |
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. | |
SoA container handling functions | |
template<typename SCHEMA > | |
VECMEM_NODISCARD event_type | setup (edm::view< SCHEMA > data) const |
Set up the internal state of a buffer correctly on a device. | |
template<typename... VARTYPES> | |
VECMEM_NODISCARD event_type | memset (edm::view< edm::schema< VARTYPES... > > data, int value) const |
Set all bytes of the container to some value. | |
template<typename... VARTYPES> | |
edm::buffer< edm::details::remove_cv_t< edm::schema< VARTYPES... > > > | to (const edm::view< edm::schema< VARTYPES... > > &data, memory_resource &resource, memory_resource *host_access_resource=nullptr, type::copy_type cptype=type::unknown) const |
Copy a jagged vector to the specified memory resource. | |
template<typename... VARTYPES> | |
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. | |
template<typename... VARTYPES, template< typename > class INTERFACE> | |
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. | |
template<typename... VARTYPES> | |
edm::view< edm::schema< VARTYPES... > >::size_type | get_size (const edm::view< edm::schema< VARTYPES... > > &data) const |
Get the (outer) size of a (resizable) SoA container. | |
template<typename... VARTYPES> | |
std::vector< data::vector_view< int >::size_type > | get_sizes (const edm::view< edm::schema< VARTYPES... > > &data) const |
Get the (inner) size of a (resizable) SoA container. | |
Protected Member Functions | |
VECMEM_HIP_EXPORT void | do_copy (std::size_t size, const void *from, void *to, type::copy_type cptype) const final |
Perform an asynchronous memory copy using HIP. | |
VECMEM_HIP_EXPORT void | do_memset (std::size_t size, void *ptr, int value) const final |
Fill a memory area using HIP asynchronously. | |
VECMEM_HIP_EXPORT event_type | create_event () const final |
Create an event for synchronization. | |
virtual void | do_copy (std::size_t size, const void *from, void *to, type::copy_type cptype) const |
Perform a "low level" memory copy. | |
Specialisation of vecmem::copy
for HIP.
This specialisation of vecmem::copy
, unlike vecmem::hip::copy
, performs all of its operations asynchronously. Using the HIP stream that is given to its constructor.
It is up to the user to ensure that copy operations are performed in the right order, and they would finish before an operation that needs them is executed.
|
finalprotectedvirtual |
Create an event for synchronization.
Reimplemented from vecmem::copy.
|
finalprotectedvirtual |
Fill a memory area using HIP asynchronously.
Reimplemented from vecmem::copy.