15 #include "vecmem/containers/vector.hpp"
26 namespace Acts::Sycl {
27 template <
typename external_spacepo
int_t>
33 vecmem::memory_resource* device_resource)
37 m_wrappedQueue(std::
move(wrappedQueue)),
38 m_resource(&resource),
39 m_device_resource(device_resource) {
53 seedFilterConfig.deltaInvHelixDiameter,
54 seedFilterConfig.impactWeightFactor,
55 seedFilterConfig.deltaRMin,
56 seedFilterConfig.compatSeedWeight,
58 seedFilterConfig.compatSeedLimit,
62 template <
typename external_spacepo
int_t>
63 template <
typename sp_range_t>
64 std::vector<Acts::Seed<external_spacepoint_t>>
68 const sp_range_t& bottomSPs,
const std::size_t middleSPs,
69 const sp_range_t& topSPs)
const {
70 std::vector<Seed<external_spacepoint_t>> outputVec;
78 vecmem::vector<detail::DeviceSpacePoint> deviceBottomSPs(m_resource);
79 vecmem::vector<detail::DeviceSpacePoint> deviceMiddleSPs(m_resource);
80 vecmem::vector<detail::DeviceSpacePoint> deviceTopSPs(m_resource);
82 std::vector<Acts::InternalSpacePoint<external_spacepoint_t>*> bottomSPvec;
83 std::vector<Acts::InternalSpacePoint<external_spacepoint_t>*> middleSPvec;
84 std::vector<Acts::InternalSpacePoint<external_spacepoint_t>*> topSPvec;
86 for (std::size_t SPidx : bottomSPs) {
87 auto& sp_collection = grid.
at(SPidx);
88 for (
auto&
SP : sp_collection) {
89 bottomSPvec.push_back(
SP.get());
92 deviceBottomSPs.reserve(bottomSPvec.size());
93 for (
auto SP : bottomSPvec) {
94 deviceBottomSPs.push_back({
SP->x(),
SP->y(),
SP->z(),
SP->radius(),
95 SP->varianceR(),
SP->varianceZ()});
99 auto& sp_collection = grid.
at(middleSPs);
100 for (
auto&
SP : sp_collection) {
101 middleSPvec.push_back(
SP.get());
104 deviceMiddleSPs.reserve(middleSPvec.size());
105 for (
auto SP : middleSPvec) {
106 deviceMiddleSPs.push_back({
SP->x(),
SP->y(),
SP->z(),
SP->radius(),
107 SP->varianceR(),
SP->varianceZ()});
110 for (
auto SPidx : topSPs) {
111 auto& sp_collection = grid.
at(SPidx);
112 for (
auto&
SP : sp_collection) {
113 topSPvec.push_back(
SP.get());
116 deviceTopSPs.reserve(topSPvec.size());
117 for (
auto SP : topSPvec) {
118 deviceTopSPs.push_back({
SP->x(),
SP->y(),
SP->z(),
SP->radius(),
119 SP->varianceR(),
SP->varianceZ()});
123 std::vector<std::vector<detail::SeedData>> seeds;
127 m_deviceConfig, m_deviceCuts, deviceBottomSPs,
128 deviceMiddleSPs, deviceTopSPs, seeds);
136 for (
size_t mi = 0; mi < seeds.size(); ++mi) {
138 for (
size_t j = 0;
j < seeds[mi].size(); ++
j) {
139 auto& bottomSP = *(bottomSPvec[seeds[mi][
j].bottom]);
140 auto& middleSP = *(middleSPvec[mi]);
141 auto& topSP = *(topSPvec[seeds[mi][
j].top]);
142 float weight = seeds[mi][
j].weight;
144 candidates.emplace_back(bottomSP, middleSP, topSP, weight, 0,
false);
147 candidates.begin(), candidates.end(),
149 descendingByQuality);
150 std::size_t numQualitySeeds = 0;
151 m_config.seedFilter->filterSeeds_1SpFixed(spacePointData, candidates,
153 std::back_inserter(outputVec));