13
13
namespace traccc ::device {
14
14
15
15
TRACCC_HOST_DEVICE inline void build_tracks (
16
- const global_index_t globalIndex, const finding_config& cfg,
16
+ const global_index_t globalIndex,
17
+ [[maybe_unused]] const finding_config& cfg,
17
18
const build_tracks_payload& payload) {
18
19
19
20
const measurement_collection_types::const_device measurements (
@@ -47,11 +48,13 @@ TRACCC_HOST_DEVICE inline void build_tracks(
47
48
48
49
const unsigned int n_cands = L.step + 1 - L.n_skipped ;
49
50
51
+ // Criteria for valid tracks
52
+ assert (n_cands >= cfg.min_track_candidates_per_track &&
53
+ n_cands <= cfg.max_track_candidates_per_track );
54
+
50
55
// Resize the candidates with the exact size
51
56
cands_per_track.resize (n_cands);
52
57
53
- bool success = true ;
54
-
55
58
// Track summary variables
56
59
scalar ndf_sum = 0 .f ;
57
60
scalar chi2_sum = 0 .f ;
@@ -67,11 +70,7 @@ TRACCC_HOST_DEVICE inline void build_tracks(
67
70
L = links.at (L.previous_candidate_idx );
68
71
}
69
72
70
- // Break if the measurement is still invalid
71
- if (L.meas_idx >= measurements.size ()) {
72
- success = false ;
73
- break ;
74
- }
73
+ assert (L.meas_idx < n_meas);
75
74
76
75
*it = {measurements.at (L.meas_idx )};
77
76
num_inserted++;
@@ -97,36 +96,27 @@ TRACCC_HOST_DEVICE inline void build_tracks(
97
96
}
98
97
99
98
#ifndef NDEBUG
100
- if (success) {
101
- // Assert that we inserted exactly as many elements as we reserved
102
- // space for.
103
- assert (num_inserted == cands_per_track.size ());
104
-
105
- // Assert that we did not make any duplicate track states.
106
- for (unsigned int i = 0 ; i < cands_per_track.size (); ++i) {
107
- for (unsigned int j = 0 ; j < cands_per_track.size (); ++j) {
108
- if (i != j) {
109
- // TODO: Re-enable me!
110
- // assert(cands_per_track.at(i).measurement_id !=
111
- // cands_per_track.at(j).measurement_id);
112
- }
99
+ // Assert that we inserted exactly as many elements as we reserved
100
+ // space for.
101
+ assert (num_inserted == cands_per_track.size ());
102
+
103
+ // Assert that we did not make any duplicate track states.
104
+ for (unsigned int i = 0 ; i < cands_per_track.size (); ++i) {
105
+ for (unsigned int j = 0 ; j < cands_per_track.size (); ++j) {
106
+ if (i != j) {
107
+ // TODO: Re-enable me!
108
+ // assert(cands_per_track.at(i).measurement_id !=
109
+ // cands_per_track.at(j).measurement_id);
113
110
}
114
111
}
115
112
}
116
113
#endif
117
114
118
- // NOTE: We may at some point want to assert that `success` is true
115
+ vecmem::device_atomic_ref<unsigned int > num_valid_tracks (
116
+ *payload.n_valid_tracks );
119
117
120
- // Criteria for valid tracks
121
- if (n_cands >= cfg.min_track_candidates_per_track &&
122
- n_cands <= cfg.max_track_candidates_per_track && success) {
123
-
124
- vecmem::device_atomic_ref<unsigned int > num_valid_tracks (
125
- *payload.n_valid_tracks );
126
-
127
- const unsigned int pos = num_valid_tracks.fetch_add (1 );
128
- valid_indices[pos] = globalIndex;
129
- }
118
+ const unsigned int pos = num_valid_tracks.fetch_add (1 );
119
+ valid_indices[pos] = globalIndex;
130
120
}
131
121
132
122
} // namespace traccc::device
0 commit comments