Skip to content

Commit

Permalink
Test in seeding DO NOT PUSH
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenswat committed Sep 20, 2022
1 parent 7f4a4e4 commit a208c63
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion examples/run/cuda/seeding_example_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
// Project include(s).
#include "traccc/cuda/seeding/seeding_algorithm.hpp"
#include "traccc/cuda/seeding/track_params_estimation.hpp"
#include "traccc/cuda/seeding2/seed_finding.hpp"
#include "traccc/efficiency/seeding_performance_writer.hpp"
#include "traccc/io/csv.hpp"
#include "traccc/io/reader.hpp"
Expand Down Expand Up @@ -57,7 +58,7 @@ int seq_run(const traccc::seeding_input_config& i_cfg,
traccc::seeding_algorithm sa(host_mr);
traccc::track_params_estimation tp(host_mr);

traccc::cuda::seeding_algorithm sa_cuda({mng_mr});
traccc::cuda::seed_finding2 sa_cuda({mng_mr});
traccc::cuda::track_params_estimation tp_cuda({mng_mr});

// performance writer
Expand Down Expand Up @@ -175,11 +176,21 @@ int seq_run(const traccc::seeding_input_config& i_cfg,
std::vector<std::array<traccc::spacepoint, 3>> sp3_vector_cuda =
traccc::get_spacepoint_vector(seeds_cuda,
spacepoints_per_event);
/*
for (std::size_t i = 0; i < sp3_vector.size(); ++i) {
std::cout << "CPU SEED " << i <<": (" << sp3_vector[i][0].x() << ", " << sp3_vector[i][0].y() << ", " << sp3_vector[i][0].z() << ") -> (" << sp3_vector[i][1].x() << ", " << sp3_vector[i][1].y() << ", " << sp3_vector[i][1].z() << ") -> ("<< ") -> (" << sp3_vector[i][2].x() << ", " << sp3_vector[i][2].y() << ", " << sp3_vector[i][2].z() << ")" << std::endl;
}
for (std::size_t i = 0; i < sp3_vector_cuda.size(); ++i) {
std::cout << "CUDA SEED " << i <<": (" << sp3_vector_cuda[i][0].x() << ", " << sp3_vector_cuda[i][0].y() << ", " << sp3_vector_cuda[i][0].z() << ") -> (" << sp3_vector_cuda[i][1].x() << ", " << sp3_vector_cuda[i][1].y() << ", " << sp3_vector_cuda[i][1].z() << ") -> ("<< ") -> (" << sp3_vector_cuda[i][2].x() << ", " << sp3_vector_cuda[i][2].y() << ", " << sp3_vector_cuda[i][2].z() << ")" << std::endl;
}
*/
for (const auto& sp3 : sp3_vector) {
if (std::find(sp3_vector_cuda.cbegin(), sp3_vector_cuda.cend(),
sp3) != sp3_vector_cuda.cend()) {
n_match++;
} else {
std::cout << " Spacepoint not found: (x=" << sp3[0].x() << ", y=" << sp3[0].y() << ", z=" << sp3[0].z() << ", r=" << sp3[0].radius() << ", phi=" << atan2(sp3[0].y(), sp3[0].x()) << ") -> (x=" << sp3[1].x() << ", y=" << sp3[1].y() << ", z=" << sp3[1].z() << ", r=" << sp3[1].radius() << ", phi=" << atan2(sp3[1].y(), sp3[1].x()) << ") -> (x=" << sp3[2].x() << ", y=" << sp3[2].y() << ", z=" << sp3[2].z() << ", r=" << sp3[2].radius() << ", phi=" << atan2(sp3[2].y(), sp3[2].x()) << ")" << std::endl;
}
}

Expand Down

0 comments on commit a208c63

Please sign in to comment.