Skip to content

Commit 21f3453

Browse files
authored
Merge pull request #760 from krasznaa/DeTemplateSYCL-main-20241030
De-Template the SYCL Library, main branch (2024.11.01.)
2 parents c313477 + f006724 commit 21f3453

18 files changed

+597
-373
lines changed

device/sycl/CMakeLists.txt

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,19 @@ enable_language( SYCL )
1313

1414
# Set up the build of the traccc::sycl library.
1515
traccc_add_library( traccc_sycl sycl TYPE SHARED
16+
# Spacepoint formation algorithm.
17+
"include/traccc/sycl/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp"
18+
"src/seeding/silicon_pixel_spacepoint_formation_algorithm.cpp"
19+
"src/seeding/silicon_pixel_spacepoint_formation_algorithm_default_detector.sycl"
20+
"src/seeding/silicon_pixel_spacepoint_formation_algorithm_telescope_detector.sycl"
21+
"src/seeding/silicon_pixel_spacepoint_formation.hpp"
22+
# Track fitting algorithm.
23+
"include/traccc/sycl/fitting/kalman_fitting_algorithm.hpp"
24+
"src/fitting/kalman_fitting_algorithm.cpp"
25+
"src/fitting/kalman_fitting_algorithm_constant_field_default_detector.sycl"
26+
"src/fitting/kalman_fitting_algorithm_constant_field_telescope_detector.sycl"
27+
"src/fitting/fit_tracks.hpp"
1628
# header files
17-
"include/traccc/sycl/fitting/fitting_algorithm.hpp"
18-
"include/traccc/sycl/seeding/spacepoint_formation_algorithm.hpp"
1929
"include/traccc/sycl/seeding/seeding_algorithm.hpp"
2030
"include/traccc/sycl/seeding/seed_finding.hpp"
2131
"include/traccc/sycl/seeding/spacepoint_binning.hpp"
@@ -25,8 +35,6 @@ traccc_add_library( traccc_sycl sycl TYPE SHARED
2535
"include/traccc/sycl/utils/make_prefix_sum_buff.hpp"
2636
# implementation files
2737
"src/clusterization/clusterization_algorithm.sycl"
28-
"src/fitting/fitting_algorithm.sycl"
29-
"src/seeding/spacepoint_formation_algorithm.sycl"
3038
"src/seeding/seed_finding.sycl"
3139
"src/seeding/seeding_algorithm.cpp"
3240
"src/seeding/spacepoint_binning.sycl"

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

Lines changed: 0 additions & 66 deletions
This file was deleted.
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
/** TRACCC library, part of the ACTS project (R&D line)
2+
*
3+
* (c) 2022-2024 CERN for the benefit of the ACTS project
4+
*
5+
* Mozilla Public License Version 2.0
6+
*/
7+
8+
#pragma once
9+
10+
// SYCL library include(s).
11+
#include "traccc/sycl/utils/queue_wrapper.hpp"
12+
13+
// Project include(s).
14+
#include "traccc/edm/track_candidate.hpp"
15+
#include "traccc/edm/track_state.hpp"
16+
#include "traccc/fitting/fitting_config.hpp"
17+
#include "traccc/geometry/detector.hpp"
18+
#include "traccc/utils/algorithm.hpp"
19+
#include "traccc/utils/memory_resource.hpp"
20+
21+
// Detray include(s).
22+
#include <detray/detectors/bfield.hpp>
23+
24+
// VecMem include(s).
25+
#include <vecmem/utils/copy.hpp>
26+
27+
// System include(s).
28+
#include <functional>
29+
30+
namespace traccc::sycl {
31+
32+
/// Kalman filter based track fitting algorithm
33+
class kalman_fitting_algorithm
34+
: public algorithm<track_state_container_types::buffer(
35+
const default_detector::view&,
36+
const detray::bfield::const_field_t::view_t&,
37+
const track_candidate_container_types::const_view&)>,
38+
public algorithm<track_state_container_types::buffer(
39+
const telescope_detector::view&,
40+
const detray::bfield::const_field_t::view_t&,
41+
const track_candidate_container_types::const_view&)> {
42+
43+
public:
44+
/// Configuration type
45+
using config_type = fitting_config;
46+
/// Output type
47+
using output_type = track_state_container_types::buffer;
48+
49+
/// Constructor with the algorithm's configuration
50+
///
51+
/// @param config The configuration object
52+
///
53+
kalman_fitting_algorithm(const config_type& config,
54+
const traccc::memory_resource& mr,
55+
vecmem::copy& copy, queue_wrapper queue);
56+
57+
/// Execute the algorithm
58+
///
59+
/// @param det The (default) detector object
60+
/// @param field The (constant) magnetic field object
61+
/// @param track_candidates All track candidates to fit
62+
///
63+
/// @return A container of the fitted track states
64+
///
65+
output_type operator()(const default_detector::view& det,
66+
const detray::bfield::const_field_t::view_t& field,
67+
const track_candidate_container_types::const_view&
68+
track_candidates) const override;
69+
70+
/// Execute the algorithm
71+
///
72+
/// @param det The (telescope) detector object
73+
/// @param field The (constant) magnetic field object
74+
/// @param track_candidates All track candidates to fit
75+
///
76+
/// @return A container of the fitted track states
77+
///
78+
output_type operator()(const telescope_detector::view& det,
79+
const detray::bfield::const_field_t::view_t& field,
80+
const track_candidate_container_types::const_view&
81+
track_candidates) const override;
82+
83+
private:
84+
/// Algorithm configuration
85+
config_type m_config;
86+
/// Memory resource used by the algorithm
87+
traccc::memory_resource m_mr;
88+
/// Copy object used by the algorithm
89+
std::reference_wrapper<vecmem::copy> m_copy;
90+
/// Queue wrapper
91+
mutable queue_wrapper m_queue;
92+
93+
}; // class kalman_fitting_algorithm
94+
95+
} // namespace traccc::sycl
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
/** TRACCC library, part of the ACTS project (R&D line)
2+
*
3+
* (c) 2023-2024 CERN for the benefit of the ACTS project
4+
*
5+
* Mozilla Public License Version 2.0
6+
*/
7+
8+
#pragma once
9+
10+
// Library include(s).
11+
#include "traccc/edm/measurement.hpp"
12+
#include "traccc/edm/spacepoint.hpp"
13+
#include "traccc/geometry/detector.hpp"
14+
#include "traccc/sycl/utils/queue_wrapper.hpp"
15+
#include "traccc/utils/algorithm.hpp"
16+
#include "traccc/utils/memory_resource.hpp"
17+
18+
// VecMem include(s).
19+
#include <vecmem/utils/copy.hpp>
20+
21+
// System include(s).
22+
#include <functional>
23+
24+
namespace traccc::sycl {
25+
26+
/// Algorithm forming space points out of measurements
27+
///
28+
/// This algorithm performs the local-to-global transformation of the 2D
29+
/// measurements made on every detector module, into 3D spacepoint coordinates.
30+
///
31+
class silicon_pixel_spacepoint_formation_algorithm
32+
: public algorithm<spacepoint_collection_types::buffer(
33+
const default_detector::view&,
34+
const measurement_collection_types::const_view&)>,
35+
public algorithm<spacepoint_collection_types::buffer(
36+
const telescope_detector::view&,
37+
const measurement_collection_types::const_view&)> {
38+
39+
public:
40+
/// Output type
41+
using output_type = spacepoint_collection_types::buffer;
42+
43+
/// Constructor for spacepoint_formation
44+
///
45+
/// @param mr is the memory resource
46+
///
47+
silicon_pixel_spacepoint_formation_algorithm(
48+
const traccc::memory_resource& mr, vecmem::copy& copy,
49+
queue_wrapper queue);
50+
51+
/// Construct spacepoints from 2D silicon pixel measurements
52+
///
53+
/// @param det Detector object
54+
/// @param measurements A collection of measurements
55+
/// @return A spacepoint buffer, with one spacepoint for every
56+
/// silicon pixel measurement
57+
///
58+
output_type operator()(const default_detector::view& det,
59+
const measurement_collection_types::const_view&
60+
measurements) const override;
61+
62+
/// Construct spacepoints from 2D silicon pixel measurements
63+
///
64+
/// @param det Detector object
65+
/// @param measurements A collection of measurements
66+
/// @return A spacepoint buffer, with one spacepoint for every
67+
/// silicon pixel measurement
68+
///
69+
output_type operator()(const telescope_detector::view& det,
70+
const measurement_collection_types::const_view&
71+
measurements) const override;
72+
73+
private:
74+
/// Memory resource used by the algorithm
75+
traccc::memory_resource m_mr;
76+
/// The copy object to use
77+
std::reference_wrapper<vecmem::copy> m_copy;
78+
/// SYCL queue object
79+
mutable queue_wrapper m_queue;
80+
};
81+
82+
} // namespace traccc::sycl

device/sycl/include/traccc/sycl/seeding/spacepoint_formation_algorithm.hpp

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

0 commit comments

Comments
 (0)