ATLAS Offline Software
Loading...
Searching...
No Matches
DeviceSeedContainers.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4#ifndef ACTSGPUEVENT_DEVICESEEDCONTAINERS_H
5#define ACTSGPUEVENT_DEVICESEEDCONTAINERS_H
6
7// Device-side interface of the seed conversion. Included by the .cu (nvcc)
8// and the algorithm header: keep Athena algorithm/StoreGate headers OUT.
9
10#include "GaudiKernel/StatusCode.h"
11
12#include "traccc/definitions/qualifiers.hpp"
13#include <traccc/edm/seed_collection.hpp>
14#include <traccc/edm/spacepoint_collection.hpp>
15#include <vecmem/containers/data/vector_view.hpp>
16#include <vecmem/edm/container.hpp>
17#include <vecmem/memory/memory_resource.hpp>
18#include <vecmem/utils/copy.hpp>
19
20#include <cuda_runtime_api.h>
21
22#include <array>
23#include <memory>
24
25namespace ActsTrk {
26
27// vecmem objects use this type for size
28using size_type = unsigned int;
29
31inline constexpr unsigned int kDeviceSeedNSp = 3u;
33inline constexpr unsigned int kDeviceSeedInvalidIndex = 0xFFFFFFFFu;
34
36template <typename BASE>
37class DeviceSeed : public BASE {
38 public:
39 using BASE::BASE;
40 using BASE::operator=;
41
44 TRACCC_HOST_DEVICE
45 auto& sp_indices() { return BASE::template get<0>(); }
46 TRACCC_HOST_DEVICE
47 const auto& sp_indices() const { return BASE::template get<0>(); }
48
50 TRACCC_HOST_DEVICE
51 auto& quality() { return BASE::template get<1>(); }
52 TRACCC_HOST_DEVICE
53 const auto& quality() const { return BASE::template get<1>(); }
54};
55
56using DeviceSeedContainer = vecmem::edm::container<
58 // sp_indices
59 , vecmem::edm::type::vector<std::array<unsigned int, kDeviceSeedNSp>>
60 // quality
61 , vecmem::edm::type::vector<float>
62 >;
63
67 cudaStream_t stream
68 , vecmem::memory_resource & mr
69 , vecmem::copy const & copy
70 , size_type nb_seeds
71 , const traccc::edm::seed_collection::const_view & input_seeds
72 , const traccc::edm::spacepoint_collection::const_view & input_spacepoints
73 , const vecmem::data::vector_view<const unsigned int> & meas_to_host_sp
74 , std::unique_ptr<DeviceSeedContainer::buffer> & output_seeds
75 );
76
77} // namespace ActsTrk
78
79#endif // ACTSGPUEVENT_DEVICESEEDCONTAINERS_H
One entry per traccc seed, in seed order.
TRACCC_HOST_DEVICE const auto & sp_indices() const
TRACCC_HOST_DEVICE auto & sp_indices()
TRACCC_HOST_DEVICE auto & quality()
TRACCC_HOST_DEVICE const auto & quality() const
T * get(TKey *tobj)
get a TObject* from a TKey* (why can't a TObject be a TKey?)
Definition hcg.cxx:132
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...
constexpr unsigned int kDeviceSeedInvalidIndex
No host index marker (as in measMap).
unsigned int size_type
StatusCode convertSeedsOnGPU(cudaStream_t stream, vecmem::memory_resource &mr, vecmem::copy const &copy, size_type nb_seeds, const traccc::edm::seed_collection::const_view &input_seeds, const traccc::edm::spacepoint_collection::const_view &input_spacepoints, const vecmem::data::vector_view< const unsigned int > &meas_to_host_sp, std::unique_ptr< DeviceSeedContainer::buffer > &output_seeds)
Seeds -> host SP indices + quality.
constexpr unsigned int kDeviceSeedNSp
Spacepoints per seed (bottom, middle, top).
vecmem::edm::container< DeviceSeed, vecmem::edm::type::vector< std::array< unsigned int, kDeviceSeedNSp > >, vecmem::edm::type::vector< float > > DeviceSeedContainer