Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-07-26 08:22:05

0001 /** TRACCC library, part of the ACTS project (R&D line)
0002  *
0003  * (c) 2022-2026 CERN for the benefit of the ACTS project
0004  *
0005  * Mozilla Public License Version 2.0
0006  */
0007 
0008 #pragma once
0009 
0010 // Project include(s).
0011 #include "traccc/clusterization/clustering_config.hpp"
0012 #include "traccc/clusterization/device/ccl_kernel_definitions.hpp"
0013 #include "traccc/definitions/hints.hpp"
0014 #include "traccc/definitions/qualifiers.hpp"
0015 #include "traccc/device/concepts/barrier.hpp"
0016 #include "traccc/device/concepts/thread_id.hpp"
0017 #include "traccc/edm/measurement_collection.hpp"
0018 #include "traccc/edm/silicon_cell_collection.hpp"
0019 #include "traccc/geometry/detector_conditions_description.hpp"
0020 #include "traccc/geometry/detector_design_description.hpp"
0021 
0022 // Vecmem include(s).
0023 #include <vecmem/containers/data/vector_view.hpp>
0024 #include <vecmem/memory/memory_resource.hpp>
0025 
0026 // System include(s).
0027 #include <cstddef>
0028 
0029 namespace traccc::device {
0030 
0031 /// Function which reads raw detector cells and turns them into measurements.
0032 ///
0033 /// @param[in] cfg clustering configuration
0034 /// @param[in] thread_id a thread identifier object
0035 /// @param[in] cells_view    collection of cells
0036 /// @param[in] det_descr_view The detectorsegmentation description
0037 /// @param[in] det_cond_view The detector conditions description
0038 /// @param partition_start    partition start point for this thread block
0039 /// @param partition_end      partition end point for this thread block
0040 /// @param outi               number of measurements for this partition
0041 /// @param f_view  array of "parent" indices for all cells in this partition
0042 /// @param gf_view array of "grandparent" indices for all cells in this
0043 ///                partition
0044 /// @param f_backup_view global memory alternative to `f_view` for cases in
0045 ///     which that array is not large enough
0046 /// @param gf_backup_view global memory alternative to `gf_view` for cases in
0047 ///     which that array is not large enough
0048 /// @param adjc_backup_view global memory alternative to the adjacent cell
0049 ///     count vector
0050 /// @param adjv_backup_view global memory alternative to the cell adjacency
0051 ///     matrix fragment storage
0052 /// @param backup_mutex mutex lock to mediate control over the backup global
0053 ///     memory data structures.
0054 /// @param[out] disjoint_set_view Array of unsigned integers of
0055 ///     length $|cells|$ to which an integer is written identifying the
0056 ///     measurement index to which each cell belongs.
0057 /// @param[out] cluster_size_view Array of unsigned integers of
0058 ///     size $|cells|$; the first $N$ elements - where $N$ is the number of
0059 ///     output measurements - will have their value set to the size of the
0060 ///     corresponding measurement.
0061 /// @param barrier  A generic object for block-wide synchronisation
0062 /// @param[out] measurements_view collection of measurements
0063 template <device::concepts::barrier barrier_t,
0064           device::concepts::thread_id1 thread_id_t>
0065 TRACCC_HOST_DEVICE inline void ccl_kernel(
0066     const clustering_config cfg, const thread_id_t& thread_id,
0067     const edm::silicon_cell_collection::const_view& cells_view,
0068     const detector_design_description::const_view& det_descr_view,
0069     const detector_conditions_description::const_view& det_cond_view,
0070     std::size_t& partition_start, std::size_t& partition_end, std::size_t& outi,
0071     vecmem::data::vector_view<details::index_t> f_view,
0072     vecmem::data::vector_view<details::index_t> gf_view,
0073     vecmem::data::vector_view<details::fallback_index_t> f_backup_view,
0074     vecmem::data::vector_view<details::fallback_index_t> gf_backup_view,
0075     vecmem::data::vector_view<unsigned char> adjc_backup_view,
0076     vecmem::data::vector_view<details::fallback_index_t> adjv_backup_view,
0077     vecmem::device_atomic_ref<uint32_t> backup_mutex,
0078     vecmem::data::vector_view<unsigned int> disjoint_set_view,
0079     vecmem::data::vector_view<unsigned int> cluster_size_view,
0080     const barrier_t& barrier,
0081     edm::measurement_collection::view measurements_view);
0082 
0083 }  // namespace traccc::device
0084 
0085 // Include the implementation.
0086 #include "traccc/clusterization/device/impl/ccl_kernel.ipp"