Skip to content

Commit 21b8216

Browse files
authored
Merge pull request #1026 from krasznaa/AlpakaTemplatingRewrite-main-20250618
Alpaka Templating Rewrite, main branch (2025.06.18.)
1 parent 919a082 commit 21b8216

24 files changed

+1148
-1010
lines changed

device/alpaka/CMakeLists.txt

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -51,18 +51,18 @@ traccc_add_alpaka_library( traccc_alpaka alpaka TYPE SHARED
5151
"src/seeding/seeding_algorithm.cpp"
5252
"include/traccc/alpaka/seeding/track_params_estimation.hpp"
5353
"src/seeding/track_params_estimation.cpp"
54-
# Finding
55-
"include/traccc/alpaka/finding/finding_algorithm.hpp"
56-
"src/finding/finding_algorithm.cpp"
57-
"src/finding/kernels/make_barcode_sequence.hpp"
58-
"src/finding/kernels/apply_interaction.hpp"
59-
"src/finding/kernels/fill_sort_keys.hpp"
60-
"src/finding/kernels/build_tracks.hpp"
61-
"src/finding/kernels/find_tracks.hpp"
62-
"src/finding/kernels/propagate_to_next_surface.hpp"
63-
# Fitting
64-
"include/traccc/alpaka/fitting/fitting_algorithm.hpp"
65-
"src/fitting/fitting_algorithm.cpp"
54+
# Track finding algorithm(s).
55+
"include/traccc/alpaka/finding/combinatorial_kalman_filter_algorithm.hpp"
56+
"src/finding/combinatorial_kalman_filter_algorithm.cpp"
57+
"src/finding/combinatorial_kalman_filter_algorithm_constant_field_default_detector.cpp"
58+
"src/finding/combinatorial_kalman_filter_algorithm_constant_field_telescope_detector.cpp"
59+
"src/finding/find_tracks.hpp"
60+
# Track fitting algorithm(s).
61+
"include/traccc/alpaka/fitting/kalman_fitting_algorithm.hpp"
62+
"src/fitting/kalman_fitting_algorithm.cpp"
63+
"src/fitting/kalman_fitting_algorithm_constant_field_default_detector.cpp"
64+
"src/fitting/kalman_fitting_algorithm_constant_field_telescope_detector.cpp"
65+
"src/fitting/fit_tracks.hpp"
6666
)
6767

6868
# Set up Thrust specifically for the traccc::alpaka library.
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
/** TRACCC library, part of the ACTS project (R&D line)
2+
*
3+
* (c) 2025 CERN for the benefit of the ACTS project
4+
*
5+
* Mozilla Public License Version 2.0
6+
*/
7+
8+
#pragma once
9+
10+
// Local include(s).
11+
#include "traccc/alpaka/utils/queue.hpp"
12+
13+
// Project include(s).
14+
#include "traccc/edm/measurement.hpp"
15+
#include "traccc/edm/track_candidate_collection.hpp"
16+
#include "traccc/edm/track_parameters.hpp"
17+
#include "traccc/finding/finding_config.hpp"
18+
#include "traccc/geometry/detector.hpp"
19+
#include "traccc/utils/algorithm.hpp"
20+
#include "traccc/utils/bfield.hpp"
21+
#include "traccc/utils/detector_type_utils.hpp"
22+
#include "traccc/utils/memory_resource.hpp"
23+
#include "traccc/utils/messaging.hpp"
24+
25+
// VecMem include(s).
26+
#include <vecmem/utils/copy.hpp>
27+
28+
// System include(s).
29+
#include <functional>
30+
31+
namespace traccc::alpaka {
32+
33+
/// CKF track finding algorithm
34+
class combinatorial_kalman_filter_algorithm
35+
: public algorithm<edm::track_candidate_collection<default_algebra>::buffer(
36+
const default_detector::view&,
37+
const covfie::field<traccc::const_bfield_backend_t<
38+
default_detector::device::scalar_type>>::view_t&,
39+
const measurement_collection_types::const_view&,
40+
const bound_track_parameters_collection_types::const_view&)>,
41+
public algorithm<edm::track_candidate_collection<default_algebra>::buffer(
42+
const telescope_detector::view&,
43+
const covfie::field<traccc::const_bfield_backend_t<
44+
default_detector::device::scalar_type>>::view_t&,
45+
const measurement_collection_types::const_view&,
46+
const bound_track_parameters_collection_types::const_view&)>,
47+
public messaging {
48+
49+
public:
50+
/// Configuration type
51+
using config_type = finding_config;
52+
/// Output type
53+
using output_type =
54+
edm::track_candidate_collection<default_algebra>::buffer;
55+
56+
/// Constructor with the algorithm's configuration
57+
explicit combinatorial_kalman_filter_algorithm(
58+
const config_type& config, const traccc::memory_resource& mr,
59+
vecmem::copy& copy, queue& q,
60+
std::unique_ptr<const Logger> logger = getDummyLogger().clone());
61+
62+
/// Execute the algorithm
63+
///
64+
/// @param det The (default) detector object
65+
/// @param field The (constant) magnetic field object
66+
/// @param measurements All measurements in an event
67+
/// @param seeds All seeds in an event to start the track finding
68+
/// with
69+
///
70+
/// @return A container of the found track candidates
71+
///
72+
output_type operator()(
73+
const default_detector::view& det,
74+
const covfie::field<const_bfield_backend_t<
75+
telescope_detector::device::scalar_type>>::view_t& field,
76+
const measurement_collection_types::const_view& measurements,
77+
const bound_track_parameters_collection_types::const_view& seeds)
78+
const override;
79+
80+
/// Execute the algorithm
81+
///
82+
/// @param det The (telescope) detector object
83+
/// @param field The (constant) magnetic field object
84+
/// @param measurements All measurements in an event
85+
/// @param seeds All seeds in an event to start the track finding
86+
/// with
87+
///
88+
/// @return A container of the found track candidates
89+
///
90+
output_type operator()(
91+
const telescope_detector::view& det,
92+
const covfie::field<const_bfield_backend_t<
93+
telescope_detector::device::scalar_type>>::view_t& field,
94+
const measurement_collection_types::const_view& measurements,
95+
const bound_track_parameters_collection_types::const_view& seeds)
96+
const override;
97+
98+
private:
99+
/// Algorithm configuration
100+
config_type m_config;
101+
/// Memory resource used by the algorithm
102+
traccc::memory_resource m_mr;
103+
/// Copy object used by the algorithm
104+
std::reference_wrapper<vecmem::copy> m_copy;
105+
/// Alpaka queue
106+
std::reference_wrapper<queue> m_queue;
107+
108+
}; // class combinatorial_kalman_filter_algorithm
109+
110+
} // namespace traccc::alpaka

device/alpaka/include/traccc/alpaka/finding/finding_algorithm.hpp

Lines changed: 0 additions & 100 deletions
This file was deleted.

device/alpaka/include/traccc/alpaka/fitting/fitting_algorithm.hpp

Lines changed: 0 additions & 66 deletions
This file was deleted.

0 commit comments

Comments
 (0)