Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integer comparison bugs in device CKF #694

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@

#pragma once

#include <utility>

namespace traccc::device {

TRACCC_DEVICE inline void add_links_for_holes(
Expand Down Expand Up @@ -45,8 +47,10 @@ TRACCC_DEVICE inline void add_links_for_holes(
vecmem::device_vector<candidate_link> links(links_view);

// Last step ID
const unsigned int previous_step =
(step == 0) ? std::numeric_limits<unsigned int>::max() : step - 1;
const candidate_link::link_index_type::first_type previous_step =
(step == 0) ? std::numeric_limits<
candidate_link::link_index_type::first_type>::max()
: step - 1;

if (n_candidates[globalIndex] == 0u) {

Expand All @@ -72,13 +76,15 @@ TRACCC_DEVICE inline void add_links_for_holes(
: prev_links[prev_param_to_link[globalIndex]].n_skipped);

// Add a dummy link
links.at(l_pos) = {{previous_step, globalIndex},
std::numeric_limits<unsigned int>::max(),
orig_param_id,
skip_counter + 1};
links.at(l_pos) = {
{previous_step, globalIndex},
std::numeric_limits<std::decay_t<decltype(
std::declval<candidate_link>().meas_idx)>>::max(),
orig_param_id,
skip_counter + 1};

out_params.at(l_pos) = in_params.at(globalIndex);
}
}

} // namespace traccc::device
} // namespace traccc::device
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ TRACCC_DEVICE inline void build_tracks(
// Count the number of skipped steps
unsigned int n_skipped{0u};
while (true) {

if (L.meas_idx > n_meas) {
n_skipped++;
}
Expand Down Expand Up @@ -83,11 +82,10 @@ TRACCC_DEVICE inline void build_tracks(
it++) {
i++;

while (L.meas_idx > n_meas) {
if (L.previous.first < 0) {
break;
}

while (L.meas_idx > n_meas &&
L.previous.first !=
std::numeric_limits<
candidate_link::link_index_type::first_type>::max()) {
const auto link_pos =
param_to_link[L.previous.first][L.previous.second];

Expand Down Expand Up @@ -126,4 +124,4 @@ TRACCC_DEVICE inline void build_tracks(
}
}

} // namespace traccc::device
} // namespace traccc::device
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,10 @@ TRACCC_DEVICE inline void find_tracks(
vecmem::device_vector<const unsigned int> ref_meas_idx(ref_meas_idx_view);

// Last step ID
const int previous_step =
(step == 0) ? std::numeric_limits<int>::max() : step - 1;
const candidate_link::link_index_type::first_type previous_step =
(step == 0) ? std::numeric_limits<
candidate_link::link_index_type::first_type>::max()
: step - 1;

const unsigned int n_measurements_sum = n_measurements_prefix_sum.back();
const unsigned int stride = globalIndex * cfg.n_measurements_per_thread;
Expand Down
Loading