vecmem 1.14.0
Loading...
Searching...
No Matches
data.ipp
1/* VecMem project, part of the ACTS project (R&D line)
2 *
3 * (c) 2023 CERN for the benefit of the ACTS project
4 *
5 * Mozilla Public License Version 2.0
6 */
7#pragma once
8
9// Local include(s).
10#include "vecmem/edm/details/data_traits.hpp"
11
12namespace vecmem {
13namespace edm {
14
15template <typename... VARTYPES>
16VECMEM_HOST edm::data<edm::schema<VARTYPES...>>::data(size_type size,
17 memory_resource& resource)
18 : view_type(size),
19 m_data{std::make_tuple(
20 details::data_alloc<VARTYPES>::make(size, resource)...)} {
21
22 // Set up the views for the jagged vector variables correctly.
23 details::data_view_assign<VARTYPES...>(
24 view_type::m_views, m_data, std::index_sequence_for<VARTYPES...>());
25}
26
27template <typename... VARTYPES>
28VECMEM_HOST auto edm::data<edm::schema<VARTYPES...>>::variables()
29 -> tuple_type& {
30
31 return m_data;
32}
33
34template <typename... VARTYPES>
35VECMEM_HOST auto edm::data<edm::schema<VARTYPES...>>::variables() const
36 -> const tuple_type& {
37
38 return m_data;
39}
40
41} // namespace edm
42
43template <typename... VARTYPES>
46
47 return data;
48}
49
50template <typename... VARTYPES>
51VECMEM_HOST edm::view<edm::details::add_const_t<edm::schema<VARTYPES...>>>
53
54 return data;
55}
56
57} // namespace vecmem
Technical base type for data<schema<VARTYPES...>>
Definition data.hpp:25
Technical base type for view<schema<VARTYPES...>>
Definition view.hpp:28
Main namespace for the vecmem classes/functions.
Definition atomic_ref.hpp:16
VECMEM_HOST_AND_DEVICE constexpr tuple< typename std::decay< Ts >::type... > make_tuple(Ts &&... args)
Make a tuple with automatic type deduction.
Definition tuple.ipp:88
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
Meta type describing the "schema" of an SoA container.
Definition schema.hpp:46