Skip to content

Commit 36fbe79

Browse files
authored
Merge pull request #326 from guilhermeAlmeida1/wipSeeding_NoJaggeds
Change seeding to use flat vectors of doublets and triplets.
2 parents dd1f7ce + 1da2c29 commit 36fbe79

30 files changed

+726
-906
lines changed

device/common/CMakeLists.txt

+6-9
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# TRACCC library, part of the ACTS project (R&D line)
22
#
3-
# (c) 2022 CERN for the benefit of the ACTS project
3+
# (c) 2022-2023 CERN for the benefit of the ACTS project
44
#
55
# Mozilla Public License Version 2.0
66

@@ -20,8 +20,11 @@ traccc_add_library( traccc_device_common device_common TYPE SHARED
2020
"include/traccc/device/container_d2h_copy_alg.hpp"
2121
"include/traccc/device/impl/container_d2h_copy_alg.ipp"
2222
# EDM class(es).
23+
"include/traccc/edm/device/seeding_global_counter.hpp"
2324
"include/traccc/edm/device/doublet_counter.hpp"
2425
"include/traccc/edm/device/triplet_counter.hpp"
26+
"include/traccc/edm/device/device_doublet.hpp"
27+
"include/traccc/edm/device/device_triplet.hpp"
2528
# Clusterization function(s).
2629
"include/traccc/clusterization/device/form_spacepoints.hpp"
2730
"include/traccc/clusterization/device/impl/form_spacepoints.ipp"
@@ -39,18 +42,12 @@ traccc_add_library( traccc_device_common device_common TYPE SHARED
3942
"include/traccc/seeding/device/impl/count_doublets.ipp"
4043
"include/traccc/seeding/device/find_doublets.hpp"
4144
"include/traccc/seeding/device/impl/find_doublets.ipp"
42-
"include/traccc/seeding/device/make_doublet_counter_buffer.hpp"
43-
"src/seeding/make_doublet_counter_buffer.cpp"
44-
"include/traccc/seeding/device/make_doublet_buffers.hpp"
45-
"src/seeding/make_doublet_buffers.cpp"
4645
"include/traccc/seeding/device/count_triplets.hpp"
4746
"include/traccc/seeding/device/impl/count_triplets.ipp"
47+
"include/traccc/seeding/device/reduce_triplet_counts.hpp"
48+
"include/traccc/seeding/device/impl/reduce_triplet_counts.ipp"
4849
"include/traccc/seeding/device/find_triplets.hpp"
4950
"include/traccc/seeding/device/impl/find_triplets.ipp"
50-
"include/traccc/seeding/device/make_triplet_counter_buffer.hpp"
51-
"src/seeding/make_triplet_counter_buffer.cpp"
52-
"include/traccc/seeding/device/make_triplet_buffer.hpp"
53-
"src/seeding/make_triplet_buffer.cpp"
5451
"include/traccc/seeding/device/update_triplet_weights.hpp"
5552
"include/traccc/seeding/device/impl/update_triplet_weights.ipp"
5653
"include/traccc/seeding/device/select_seeds.hpp"
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
/** TRACCC library, 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+
8+
#pragma once
9+
10+
// Project include(s).
11+
#include "traccc/edm/container.hpp"
12+
#include "traccc/edm/device/doublet_counter.hpp"
13+
#include "traccc/seeding/detail/singlet.hpp"
14+
15+
namespace traccc::device {
16+
17+
/// Doublet of middle-bottom or middle-top spacepoints
18+
struct device_doublet {
19+
/// bottom (or top) spacepoint location in internal spacepoint container
20+
sp_location sp2;
21+
22+
using link_type = device::doublet_counter_collection_types::host::size_type;
23+
/// Link to doublet counter where the middle spacepoint is stored
24+
link_type counter_link;
25+
};
26+
27+
/// Declare all device doublet collection types
28+
using device_doublet_collection_types = collection_types<device_doublet>;
29+
30+
} // namespace traccc::device
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
/** TRACCC library, 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+
8+
#pragma once
9+
10+
// Project include(s).
11+
#include "traccc/definitions/primitives.hpp"
12+
#include "traccc/edm/container.hpp"
13+
#include "traccc/edm/device/triplet_counter.hpp"
14+
15+
namespace traccc::device {
16+
17+
/// Triplets of bottom, middle and top spacepoints
18+
struct device_triplet {
19+
// bottom spacepoint location in internal spacepoint container
20+
sp_location spT;
21+
22+
using link_type = device::triplet_counter_collection_types::host::size_type;
23+
/// Link to triplet counter where the middle and bottom spacepoints are
24+
/// stored
25+
link_type counter_link;
26+
27+
/// curvature of circle estimated from triplet
28+
scalar curvature;
29+
/// weight of triplet
30+
scalar weight;
31+
/// z origin of triplet
32+
scalar z_vertex;
33+
};
34+
35+
/// Declare all device triplet collection types
36+
using device_triplet_collection_types = collection_types<device_triplet>;
37+
38+
} // namespace traccc::device
Original file line numberDiff line numberDiff line change
@@ -1,64 +1,39 @@
11
/** TRACCC library, part of the ACTS project (R&D line)
22
*
3-
* (c) 2021-2022 CERN for the benefit of the ACTS project
3+
* (c) 2021-2023 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
77

88
#pragma once
99

1010
// Project include(s).
11-
#include "traccc/definitions/qualifiers.hpp"
11+
#include "traccc/edm/container.hpp"
1212
#include "traccc/seeding/detail/singlet.hpp"
1313

1414
namespace traccc::device {
1515

16-
/// Header type for the "doublet container"
17-
///
18-
/// The header stores summary information about the number of doublets found in
19-
/// a given geometric bin.
20-
///
21-
struct doublet_counter_header {
22-
23-
/// The total number of middle-bottom spacepoint doublets in a given
24-
/// geometric bin.
25-
unsigned int m_nMidBot = 0;
26-
27-
/// The total number of middle-top spacepoint doublets in a given
28-
/// geometric bin.
29-
unsigned int m_nMidTop = 0;
30-
31-
}; // struct doublet_counter_header
32-
33-
/// Item type for the "doublet container"
34-
///
35-
/// It stores the number of doublets for one specific middle spacepoint.
36-
///
16+
/// Number of doublets for one specific middle spacepoint.
3717
struct doublet_counter {
3818

3919
/// Index of the middle spacepoint.
4020
sp_location m_spM;
4121

42-
/// The number of compatible middle-bottom doublets for the middle
43-
/// spacepoint.
22+
/// The number of compatible middle-bottom doublets
4423
unsigned int m_nMidBot = 0;
4524

46-
/// The number of compatible middle-top doublets for a the middle
47-
/// spacepoint.
25+
/// The number of compatible middle-top doublets
4826
unsigned int m_nMidTop = 0;
4927

50-
/// The position of the middle-bottom doublets
28+
/// The position in which these middle-bottom doublets will be added
5129
unsigned int m_posMidBot = 0;
5230

53-
/// The position of the middle-top doublets
31+
/// The position in which these middle-top doublets will be added
5432
unsigned int m_posMidTop = 0;
5533

5634
}; // struct doublet_counter
5735

5836
/// Declare all doublet counter collection types
5937
using doublet_counter_collection_types = collection_types<doublet_counter>;
60-
/// Declare all doublet counter container types
61-
using doublet_counter_container_types =
62-
container_types<doublet_counter_header, doublet_counter>;
6338

6439
} // namespace traccc::device
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
/** TRACCC library, 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+
8+
#pragma once
9+
10+
namespace traccc::device {
11+
12+
/// Total number of doublets and triplets found in seeding
13+
struct seeding_global_counter {
14+
15+
/// The total number of middle-bottom doublets
16+
unsigned int m_nMidBot;
17+
18+
/// The total number of middle-top doublets
19+
unsigned int m_nMidTop;
20+
21+
/// The total number of triplets
22+
unsigned int m_nTriplets;
23+
24+
}; // struct seeding_global_counter
25+
26+
} // namespace traccc::device
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** TRACCC library, part of the ACTS project (R&D line)
22
*
3-
* (c) 2021-2022 CERN for the benefit of the ACTS project
3+
* (c) 2021-2023 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
@@ -9,37 +9,40 @@
99

1010
// Project include(s).
1111
#include "traccc/edm/container.hpp"
12-
#include "traccc/seeding/detail/doublet.hpp"
12+
#include "traccc/seeding/detail/singlet.hpp"
1313

1414
namespace traccc::device {
1515

16-
/// Header type for the "triplet counter container"
17-
///
18-
/// The header stores summary information about the number of triplets found in
19-
/// a given geometric bin.
20-
///
21-
struct triplet_counter_header {
16+
/// Number of triplets for one specific middle spacepoint.
17+
struct triplet_counter_spM {
2218

23-
/// The total number of Triplets in a given geometric bin
19+
/// Middle spacepoint location in internal spacepoint container
20+
sp_location spM;
21+
22+
/// The number of triplets for this middle spacepoint
2423
unsigned int m_nTriplets = 0;
2524

26-
}; // struct triplet_counter_header
25+
/// The position in which these triplets will be added
26+
unsigned int posTriplets = 0;
27+
28+
}; // struct triplet_counter_spM
2729

28-
/// Item type for the "triplet counter container"
29-
///
30-
/// It stores the number of triplets for one specific Mid Bottom Doublet.
31-
///
30+
/// Declare all triplet counter spM collection types
31+
using triplet_counter_spM_collection_types =
32+
collection_types<triplet_counter_spM>;
33+
34+
/// Number of triplets for one specific Mid-Bottom Doublet.
3235
struct triplet_counter {
3336

34-
/// indices of two spacepoints of midbot doublet
35-
doublet m_midBotDoublet;
37+
/// Bottom spacepoint location in internal spacepoint container
38+
sp_location spB;
3639

37-
/// The number of compatible triplets for a the midbot doublet
38-
unsigned int m_nTriplets = 0;
40+
using link_type = triplet_counter_spM_collection_types::host::size_type;
41+
/// Link to the triplet counter per middle spacepoint
42+
link_type spM_counter_link;
3943

40-
/// The position of the middle top doublets with this spM
41-
unsigned int m_mt_start_idx = 0;
42-
unsigned int m_mt_end_idx;
44+
/// The number of compatible triplets for this midbot doublet
45+
unsigned int m_nTriplets = 0;
4346

4447
/// The position in which these triplets will be added
4548
unsigned int posTriplets = 0;
@@ -48,8 +51,5 @@ struct triplet_counter {
4851

4952
/// Declare all triplet counter collection types
5053
using triplet_counter_collection_types = collection_types<triplet_counter>;
51-
/// Declare all triplet counter container types
52-
using triplet_counter_container_types =
53-
container_types<triplet_counter_header, triplet_counter>;
5454

5555
} // namespace traccc::device

device/common/include/traccc/seeding/device/count_doublets.hpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** TRACCC library, part of the ACTS project (R&D line)
22
*
3-
* (c) 2021-2022 CERN for the benefit of the ACTS project
3+
* (c) 2021-2023 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
@@ -28,14 +28,18 @@ namespace traccc::device {
2828
/// @param[in] config Seedfinder configuration
2929
/// @param[in] sp_view The spacepoint grid to count doublets on
3030
/// @param[in] sp_ps_view Prefix sum for iterating over the spacepoint grid
31-
/// @param[out] doublet_view Container storing the number of doublets
31+
/// @param[out] doublet_view Collection storing the number of doublets for each
32+
/// spacepoint
33+
/// @param[out] nMidBot Total number of middle-bottom doublets
34+
/// @param[out] nMidTop Total number of middle-top doublets
3235
///
3336
TRACCC_HOST_DEVICE
3437
inline void count_doublets(
3538
std::size_t globalIndex, const seedfinder_config& config,
3639
const sp_grid_const_view& sp_view,
3740
const vecmem::data::vector_view<const prefix_sum_element_t>& sp_ps_view,
38-
doublet_counter_container_types::view doublet_view);
41+
doublet_counter_collection_types::view doublet_view, unsigned int& nMidBot,
42+
unsigned int& nMidTop);
3943

4044
} // namespace traccc::device
4145

device/common/include/traccc/seeding/device/count_triplets.hpp

+15-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/** TRACCC library, part of the ACTS project (R&D line)
22
*
3-
* (c) 2021-2022 CERN for the benefit of the ACTS project
3+
* (c) 2021-2023 CERN for the benefit of the ACTS project
44
*
55
* Mozilla Public License Version 2.0
66
*/
@@ -10,9 +10,9 @@
1010
// Project include(s).
1111
#include "traccc/definitions/qualifiers.hpp"
1212
#include "traccc/device/fill_prefix_sum.hpp"
13+
#include "traccc/edm/device/device_doublet.hpp"
1314
#include "traccc/edm/device/doublet_counter.hpp"
1415
#include "traccc/edm/device/triplet_counter.hpp"
15-
#include "traccc/seeding/detail/doublet.hpp"
1616
#include "traccc/seeding/detail/seeding_config.hpp"
1717
#include "traccc/seeding/detail/spacepoint_grid.hpp"
1818
// System include(s).
@@ -27,22 +27,24 @@ namespace traccc::device {
2727
///
2828
/// @param[in] globalIndex The index of the current thread
2929
/// @param[in] config Seedfinder configuration
30-
/// @param[in] sp_view The spacepoint grid to count doublets on
31-
/// @param[in] doublet_ps_view Prefix sum for iterating over the doublets
32-
/// @param[in] mid_bot_doublet_view Container storing the midBot doublets
33-
/// @param[in] mid_top_doublet_view Container storing the midTop doublets
34-
/// @param[out] triplet_view Container view storing the number of
35-
/// triplets
30+
/// @param[in] sp_view The spacepoint grid to count triplets on
31+
/// @param[in] dc_view Collection of doublet counters
32+
/// @param[in] mid_bot_doublet_view Collection storing the midBot doublets
33+
/// @param[in] mid_top_doublet_view Collection storing the midTop doublets
34+
/// @param[out] spM_tc Collection storing the number of triplets per middle
35+
/// spacepoint
36+
/// @param[out] mb_tc Collection storing the number of triplets per midBottom
37+
/// doublet
3638
///
3739
TRACCC_HOST_DEVICE
3840
inline void count_triplets(
3941
std::size_t globalIndex, const seedfinder_config& config,
4042
const sp_grid_const_view& sp_view,
41-
const vecmem::data::vector_view<const prefix_sum_element_t>&
42-
doublet_ps_view,
43-
const doublet_container_types::const_view mid_bot_doublet_view,
44-
const doublet_container_types::const_view mid_top_doublet_view,
45-
triplet_counter_container_types::view triplet_view);
43+
const doublet_counter_collection_types::const_view& dc_view,
44+
const device_doublet_collection_types::const_view& mid_bot_doublet_view,
45+
const device_doublet_collection_types::const_view& mid_top_doublet_view,
46+
triplet_counter_spM_collection_types::view spM_tc,
47+
triplet_counter_collection_types::view mb_tc);
4648

4749
} // namespace traccc::device
4850

0 commit comments

Comments
 (0)