Skip to content

Commit baa7fce

Browse files
authored
Merge pull request #377 from guilhermeAlmeida1/wipCommonCCLkernel
Change CCL kernel to common code
2 parents a531d8a + ff241a9 commit baa7fce

File tree

10 files changed

+487
-634
lines changed

10 files changed

+487
-634
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/** TRACCC library, part of the ACTS project (R&D line)
2+
*
3+
* (c) 2022-2023 CERN for the benefit of the ACTS project
4+
*
5+
* Mozilla Public License Version 2.0
6+
*/
7+
8+
#pragma once
9+
10+
// Project include(s).
11+
#include "traccc/definitions/qualifiers.hpp"
12+
#include "traccc/edm/alt_measurement.hpp"
13+
#include "traccc/edm/cell.hpp"
14+
#include "traccc/edm/measurement.hpp"
15+
#include "traccc/edm/spacepoint.hpp"
16+
17+
// Vecmem include(s).
18+
#include <vecmem/containers/data/vector_view.hpp>
19+
#include <vecmem/memory/memory_resource.hpp>
20+
21+
// System include(s).
22+
#include <cstddef>
23+
24+
namespace traccc::device {
25+
26+
namespace {
27+
/// These indices in clusterization will only range from 0 to
28+
/// max_cells_per_partition, so we only need a short
29+
using index_t = unsigned short;
30+
31+
static constexpr int TARGET_CELLS_PER_THREAD = 8;
32+
static constexpr int MAX_CELLS_PER_THREAD = 12;
33+
} // namespace
34+
35+
/// Function which reads raw detector cells and turns them into measurements.
36+
///
37+
/// @param[in] threadId current thread index
38+
/// @param[in] blckDim current thread block size
39+
/// @param[in] blckId current thread block index
40+
/// @param[in] cells_view collection of cells
41+
/// @param[in] modules_view collection of modules to which the cells are linked
42+
/// @param[in] max_cells_per_partition maximum number of cells per thread block
43+
/// @param[in] target_cells_per_partition average number of cells per thread
44+
/// block
45+
/// @param partition_start partition start point for this thread block
46+
/// @param partition_end partition end point for this thread block
47+
/// @param outi number of measurements for this partition
48+
/// @param f array of "parent" indices for all cells in this partition
49+
/// @param gf array of "grandparent" indices for all cells in this partition
50+
/// @param barrier A generic object for block-wide synchronisation
51+
/// @param[out] measurements_view collection of measurements
52+
/// @param[out] measurement_count number of measurements
53+
/// @param[out] cell_links collection of links to measurements each cell is
54+
/// put into
55+
template <typename barrier_t>
56+
TRACCC_DEVICE inline void ccl_kernel(
57+
const index_t threadId, const index_t blckDim, const unsigned int blockId,
58+
const cell_collection_types::const_view cells_view,
59+
const cell_module_collection_types::const_view modules_view,
60+
const index_t max_cells_per_partition,
61+
const index_t target_cells_per_partition, unsigned int& partition_start,
62+
unsigned int& partition_end, unsigned int& outi, index_t* f, index_t* gf,
63+
barrier_t& barrier,
64+
alt_measurement_collection_types::view measurements_view,
65+
unsigned int& measurement_count,
66+
vecmem::data::vector_view<unsigned int> cell_links);
67+
68+
} // namespace traccc::device
69+
70+
// Include the implementation.
71+
#include "traccc/clusterization/device/impl/ccl_kernel.ipp"

device/common/include/traccc/clusterization/device/impl/aggregate_cluster.ipp

-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,6 @@
88
#pragma once
99

1010
// Project include(s)
11-
#include <vecmem/memory/device_atomic_ref.hpp>
12-
1311
#include "traccc/clusterization/detail/measurement_creation_helper.hpp"
1412

1513
namespace traccc::device {

0 commit comments

Comments
 (0)