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