Skip to content

Commit

Permalink
Merge pull request #760 from krasznaa/DeTemplateSYCL-main-20241030
Browse files Browse the repository at this point in the history
De-Template the SYCL Library, main branch (2024.11.01.)
  • Loading branch information
krasznaa authored Nov 14, 2024
2 parents c313477 + f006724 commit 21f3453
Show file tree
Hide file tree
Showing 18 changed files with 597 additions and 373 deletions.
16 changes: 12 additions & 4 deletions device/sycl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ enable_language( SYCL )

# Set up the build of the traccc::sycl library.
traccc_add_library( traccc_sycl sycl TYPE SHARED
# Spacepoint formation algorithm.
"include/traccc/sycl/seeding/silicon_pixel_spacepoint_formation_algorithm.hpp"
"src/seeding/silicon_pixel_spacepoint_formation_algorithm.cpp"
"src/seeding/silicon_pixel_spacepoint_formation_algorithm_default_detector.sycl"
"src/seeding/silicon_pixel_spacepoint_formation_algorithm_telescope_detector.sycl"
"src/seeding/silicon_pixel_spacepoint_formation.hpp"
# Track fitting algorithm.
"include/traccc/sycl/fitting/kalman_fitting_algorithm.hpp"
"src/fitting/kalman_fitting_algorithm.cpp"
"src/fitting/kalman_fitting_algorithm_constant_field_default_detector.sycl"
"src/fitting/kalman_fitting_algorithm_constant_field_telescope_detector.sycl"
"src/fitting/fit_tracks.hpp"
# header files
"include/traccc/sycl/fitting/fitting_algorithm.hpp"
"include/traccc/sycl/seeding/spacepoint_formation_algorithm.hpp"
"include/traccc/sycl/seeding/seeding_algorithm.hpp"
"include/traccc/sycl/seeding/seed_finding.hpp"
"include/traccc/sycl/seeding/spacepoint_binning.hpp"
Expand All @@ -25,8 +35,6 @@ traccc_add_library( traccc_sycl sycl TYPE SHARED
"include/traccc/sycl/utils/make_prefix_sum_buff.hpp"
# implementation files
"src/clusterization/clusterization_algorithm.sycl"
"src/fitting/fitting_algorithm.sycl"
"src/seeding/spacepoint_formation_algorithm.sycl"
"src/seeding/seed_finding.sycl"
"src/seeding/seeding_algorithm.cpp"
"src/seeding/spacepoint_binning.sycl"
Expand Down
66 changes: 0 additions & 66 deletions device/sycl/include/traccc/sycl/fitting/fitting_algorithm.hpp

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2022-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/track_candidate.hpp"
#include "traccc/edm/track_state.hpp"
#include "traccc/fitting/fitting_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 {

/// Kalman filter based track fitting algorithm
class kalman_fitting_algorithm
: public algorithm<track_state_container_types::buffer(
const default_detector::view&,
const detray::bfield::const_field_t::view_t&,
const track_candidate_container_types::const_view&)>,
public algorithm<track_state_container_types::buffer(
const telescope_detector::view&,
const detray::bfield::const_field_t::view_t&,
const track_candidate_container_types::const_view&)> {

public:
/// Configuration type
using config_type = fitting_config;
/// Output type
using output_type = track_state_container_types::buffer;

/// Constructor with the algorithm's configuration
///
/// @param config The configuration object
///
kalman_fitting_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 track_candidates All track candidates to fit
///
/// @return A container of the fitted track states
///
output_type operator()(const default_detector::view& det,
const detray::bfield::const_field_t::view_t& field,
const track_candidate_container_types::const_view&
track_candidates) const override;

/// Execute the algorithm
///
/// @param det The (telescope) detector object
/// @param field The (constant) magnetic field object
/// @param track_candidates All track candidates to fit
///
/// @return A container of the fitted track states
///
output_type operator()(const telescope_detector::view& det,
const detray::bfield::const_field_t::view_t& field,
const track_candidate_container_types::const_view&
track_candidates) 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 kalman_fitting_algorithm

} // namespace traccc::sycl
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/** TRACCC library, part of the ACTS project (R&D line)
*
* (c) 2023-2024 CERN for the benefit of the ACTS project
*
* Mozilla Public License Version 2.0
*/

#pragma once

// Library include(s).
#include "traccc/edm/measurement.hpp"
#include "traccc/edm/spacepoint.hpp"
#include "traccc/geometry/detector.hpp"
#include "traccc/sycl/utils/queue_wrapper.hpp"
#include "traccc/utils/algorithm.hpp"
#include "traccc/utils/memory_resource.hpp"

// VecMem include(s).
#include <vecmem/utils/copy.hpp>

// System include(s).
#include <functional>

namespace traccc::sycl {

/// Algorithm forming space points out of measurements
///
/// This algorithm performs the local-to-global transformation of the 2D
/// measurements made on every detector module, into 3D spacepoint coordinates.
///
class silicon_pixel_spacepoint_formation_algorithm
: public algorithm<spacepoint_collection_types::buffer(
const default_detector::view&,
const measurement_collection_types::const_view&)>,
public algorithm<spacepoint_collection_types::buffer(
const telescope_detector::view&,
const measurement_collection_types::const_view&)> {

public:
/// Output type
using output_type = spacepoint_collection_types::buffer;

/// Constructor for spacepoint_formation
///
/// @param mr is the memory resource
///
silicon_pixel_spacepoint_formation_algorithm(
const traccc::memory_resource& mr, vecmem::copy& copy,
queue_wrapper queue);

/// Construct spacepoints from 2D silicon pixel measurements
///
/// @param det Detector object
/// @param measurements A collection of measurements
/// @return A spacepoint buffer, with one spacepoint for every
/// silicon pixel measurement
///
output_type operator()(const default_detector::view& det,
const measurement_collection_types::const_view&
measurements) const override;

/// Construct spacepoints from 2D silicon pixel measurements
///
/// @param det Detector object
/// @param measurements A collection of measurements
/// @return A spacepoint buffer, with one spacepoint for every
/// silicon pixel measurement
///
output_type operator()(const telescope_detector::view& det,
const measurement_collection_types::const_view&
measurements) const override;

private:
/// Memory resource used by the algorithm
traccc::memory_resource m_mr;
/// The copy object to use
std::reference_wrapper<vecmem::copy> m_copy;
/// SYCL queue object
mutable queue_wrapper m_queue;
};

} // namespace traccc::sycl

This file was deleted.

Loading

0 comments on commit 21f3453

Please sign in to comment.