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