ATLAS Offline Software
Loading...
Searching...
No Matches
SoACopy.h
Go to the documentation of this file.
1// Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
2#ifndef ATHDEVICEUTILS_SOACOPY_H
3#define ATHDEVICEUTILS_SOACOPY_H
4
5// Local include(s).
7
8// Project include(s).
13#include "GaudiKernel/EventContext.h"
14
15// VecMem include(s).
16#include <vecmem/edm/view.hpp>
17
18// System include(s).
19#include <tuple>
20
21namespace AthDevice {
22
24template <Concepts::SoAColumn... COLUMNS>
25class SoACopy {
26
27 public:
29 SoACopy(COLUMNS... columns);
31 SoACopy(const std::tuple<COLUMNS...>& columns);
32
41 template <typename SCHEMA>
42 void operator()(const SG::AuxVectorBase& input,
43 vecmem::edm::view<SCHEMA>& output, const EventContext& ctx,
44 const IMemoryResourcesTool& mrs,
45 const ICopiesTool& copies) const;
46
55 template <typename SCHEMA, typename INTERFACE, typename BASE>
56 void operator()(const vecmem::edm::view<SCHEMA>& input,
57 DataVector<INTERFACE, BASE>& output, const EventContext& ctx,
58 const IMemoryResourcesTool& mrs,
59 const ICopiesTool& copies) const;
60
61 private:
63 std::tuple<COLUMNS...> m_columns;
64
65}; // class SoACopy
66
69
70template <Concepts::SoAColumn... COLUMNS>
71SoACopy(COLUMNS...) -> SoACopy<COLUMNS...>;
72
73template <Concepts::SoAColumn... COLUMNS>
74SoACopy(const std::tuple<COLUMNS...>&) -> SoACopy<COLUMNS...>;
75
77
78} // namespace AthDevice
79
80// Include the implementation.
82
83#endif // ATHDEVICEUTILS_SOACOPY_H
Manage index tracking and synchronization of auxiliary data.
An STL vector of pointers that by default owns its pointed-to elements.
Interface for a tool that provides host and device copy objects.
Definition ICopiesTool.h:40
Interface for a tool that provides a main/device and a host memory resource.
Utility to help with copying data between xAOD and VecMem SoA containers.
Definition SoACopy.h:25
void operator()(const SG::AuxVectorBase &input, vecmem::edm::view< SCHEMA > &output, const EventContext &ctx, const IMemoryResourcesTool &mrs, const ICopiesTool &copies) const
Copy data from an input xAOD container into a VecMem SoA container.
void operator()(const vecmem::edm::view< SCHEMA > &input, DataVector< INTERFACE, BASE > &output, const EventContext &ctx, const IMemoryResourcesTool &mrs, const ICopiesTool &copies) const
Copy data from an input VecMem SoA container into an xAOD container.
SoACopy(const std::tuple< COLUMNS... > &columns)
Constructor with a tuple.
SoACopy(COLUMNS... columns)
Constructor with a parameter pack.
std::tuple< COLUMNS... > m_columns
Columns to copy back and forth between the containers.
Definition SoACopy.h:63
Derived DataVector<T>.
Definition DataVector.h:818
Manage index tracking and synchronization of auxiliary data.
Concept for an SoA column.
Definition SoAColumn.h:25
SoACopy(COLUMNS...) -> SoACopy< COLUMNS... >