-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SYCL Track Finding, main branch (2025.01.09.) (#811)
* Update the project to oneDPL-2022.7.1. * Introduce a CKF algorithm into traccc::sycl. While also doing some final small fixes in the common track finding code. * Add unit tests for the SYCL CKF algorithm. * Simplified the way unique kernel names are generated with. * Remove the apparently unnecessary memset.
- Loading branch information
Showing
14 changed files
with
1,369 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
103 changes: 103 additions & 0 deletions
103
device/sycl/include/traccc/sycl/finding/combinatorial_kalman_filter_algorithm.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,103 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
#pragma once | ||
|
||
// SYCL library include(s). | ||
#include "traccc/sycl/utils/queue_wrapper.hpp" | ||
|
||
// Project include(s). | ||
#include "traccc/edm/measurement.hpp" | ||
#include "traccc/edm/track_candidate.hpp" | ||
#include "traccc/edm/track_parameters.hpp" | ||
#include "traccc/finding/finding_config.hpp" | ||
#include "traccc/geometry/detector.hpp" | ||
#include "traccc/utils/algorithm.hpp" | ||
#include "traccc/utils/memory_resource.hpp" | ||
|
||
// Detray include(s). | ||
#include <detray/detectors/bfield.hpp> | ||
|
||
// VecMem include(s). | ||
#include <vecmem/utils/copy.hpp> | ||
|
||
// System include(s). | ||
#include <functional> | ||
|
||
namespace traccc::sycl { | ||
|
||
/// CKF track finding algorithm | ||
class combinatorial_kalman_filter_algorithm | ||
: public algorithm<track_candidate_container_types::buffer( | ||
const default_detector::view&, | ||
const detray::bfield::const_field_t::view_t&, | ||
const measurement_collection_types::const_view&, | ||
const bound_track_parameters_collection_types::const_view&)>, | ||
public algorithm<track_candidate_container_types::buffer( | ||
const telescope_detector::view&, | ||
const detray::bfield::const_field_t::view_t&, | ||
const measurement_collection_types::const_view&, | ||
const bound_track_parameters_collection_types::const_view&)> { | ||
|
||
public: | ||
/// Configuration type | ||
using config_type = finding_config; | ||
/// Output type | ||
using output_type = track_candidate_container_types::buffer; | ||
|
||
/// Constructor with the algorithm's configuration | ||
explicit combinatorial_kalman_filter_algorithm( | ||
const config_type& config, const traccc::memory_resource& mr, | ||
vecmem::copy& copy, queue_wrapper queue); | ||
|
||
/// Execute the algorithm | ||
/// | ||
/// @param det The (default) detector object | ||
/// @param field The (constant) magnetic field object | ||
/// @param measurements All measurements in an event | ||
/// @param seeds All seeds in an event to start the track finding | ||
/// with | ||
/// | ||
/// @return A container of the found track candidates | ||
/// | ||
output_type operator()( | ||
const default_detector::view& det, | ||
const detray::bfield::const_field_t::view_t& field, | ||
const measurement_collection_types::const_view& measurements, | ||
const bound_track_parameters_collection_types::const_view& seeds) | ||
const override; | ||
|
||
/// Execute the algorithm | ||
/// | ||
/// @param det The (telescope) detector object | ||
/// @param field The (constant) magnetic field object | ||
/// @param measurements All measurements in an event | ||
/// @param seeds All seeds in an event to start the track finding | ||
/// with | ||
/// | ||
/// @return A container of the found track candidates | ||
/// | ||
output_type operator()( | ||
const telescope_detector::view& det, | ||
const detray::bfield::const_field_t::view_t& field, | ||
const measurement_collection_types::const_view& measurements, | ||
const bound_track_parameters_collection_types::const_view& seeds) | ||
const override; | ||
|
||
private: | ||
/// Algorithm configuration | ||
config_type m_config; | ||
/// Memory resource used by the algorithm | ||
traccc::memory_resource m_mr; | ||
/// Copy object used by the algorithm | ||
std::reference_wrapper<vecmem::copy> m_copy; | ||
/// Queue wrapper | ||
mutable queue_wrapper m_queue; | ||
|
||
}; // class combinatorial_kalman_filter_algorithm | ||
|
||
} // namespace traccc::sycl |
18 changes: 18 additions & 0 deletions
18
device/sycl/src/finding/combinatorial_kalman_filter_algorithm.cpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Local include(s). | ||
#include "traccc/sycl/finding/combinatorial_kalman_filter_algorithm.hpp" | ||
|
||
namespace traccc::sycl { | ||
|
||
combinatorial_kalman_filter_algorithm::combinatorial_kalman_filter_algorithm( | ||
const config_type& config, const traccc::memory_resource& mr, | ||
vecmem::copy& copy, queue_wrapper queue) | ||
: m_config{config}, m_mr{mr}, m_copy{copy}, m_queue{queue} {} | ||
|
||
} // namespace traccc::sycl |
42 changes: 42 additions & 0 deletions
42
...cl/src/finding/combinatorial_kalman_filter_algorithm_constant_field_default_detector.sycl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Local include(s). | ||
#include "../utils/get_queue.hpp" | ||
#include "find_tracks.hpp" | ||
#include "traccc/sycl/finding/combinatorial_kalman_filter_algorithm.hpp" | ||
|
||
// Detray include(s). | ||
#include <detray/detectors/bfield.hpp> | ||
#include <detray/navigation/navigator.hpp> | ||
#include <detray/propagator/propagator.hpp> | ||
#include <detray/propagator/rk_stepper.hpp> | ||
|
||
namespace traccc::sycl { | ||
namespace kernels { | ||
struct ckf_constant_field_default_detector; | ||
} // namespace kernels | ||
|
||
combinatorial_kalman_filter_algorithm::output_type | ||
combinatorial_kalman_filter_algorithm::operator()( | ||
const default_detector::view& det, | ||
const detray::bfield::const_field_t::view_t& field, | ||
const measurement_collection_types::const_view& measurements, | ||
const bound_track_parameters_collection_types::const_view& seeds) const { | ||
|
||
// Perform the track finding using the templated implementation. | ||
return details::find_tracks< | ||
detray::rk_stepper<detray::bfield::const_field_t::view_t, | ||
default_detector::device::algebra_type, | ||
detray::constrained_step<>>, | ||
detray::navigator<const default_detector::device>, | ||
kernels::ckf_constant_field_default_detector>( | ||
det, field, measurements, seeds, m_config, m_mr, m_copy, | ||
details::get_queue(m_queue)); | ||
} | ||
|
||
} // namespace traccc::sycl |
42 changes: 42 additions & 0 deletions
42
.../src/finding/combinatorial_kalman_filter_algorithm_constant_field_telescope_detector.sycl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** TRACCC library, part of the ACTS project (R&D line) | ||
* | ||
* (c) 2024 CERN for the benefit of the ACTS project | ||
* | ||
* Mozilla Public License Version 2.0 | ||
*/ | ||
|
||
// Local include(s). | ||
#include "../utils/get_queue.hpp" | ||
#include "find_tracks.hpp" | ||
#include "traccc/sycl/finding/combinatorial_kalman_filter_algorithm.hpp" | ||
|
||
// Detray include(s). | ||
#include <detray/detectors/bfield.hpp> | ||
#include <detray/navigation/navigator.hpp> | ||
#include <detray/propagator/propagator.hpp> | ||
#include <detray/propagator/rk_stepper.hpp> | ||
|
||
namespace traccc::sycl { | ||
namespace kernels { | ||
struct ckf_constant_field_telescope_detector; | ||
} // namespace kernels | ||
|
||
combinatorial_kalman_filter_algorithm::output_type | ||
combinatorial_kalman_filter_algorithm::operator()( | ||
const telescope_detector::view& det, | ||
const detray::bfield::const_field_t::view_t& field, | ||
const measurement_collection_types::const_view& measurements, | ||
const bound_track_parameters_collection_types::const_view& seeds) const { | ||
|
||
// Perform the track finding using the templated implementation. | ||
return details::find_tracks< | ||
detray::rk_stepper<detray::bfield::const_field_t::view_t, | ||
telescope_detector::device::algebra_type, | ||
detray::constrained_step<>>, | ||
detray::navigator<const telescope_detector::device>, | ||
kernels::ckf_constant_field_telescope_detector>( | ||
det, field, measurements, seeds, m_config, m_mr, m_copy, | ||
details::get_queue(m_queue)); | ||
} | ||
|
||
} // namespace traccc::sycl |
Oops, something went wrong.