Skip to content

Commit ac5ff5b

Browse files
committed
Fix conflict
2 parents 154f3c7 + 06ba522 commit ac5ff5b

File tree

294 files changed

+7385
-4297
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

294 files changed

+7385
-4297
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/bash
2+
3+
! [[ $(find device tests -name "*\.cu" | xargs -I {} basename {} | sort | uniq -d) ]]
4+
exit $?

.pre-commit-config.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/mirrors-clang-format
3-
rev: v10.0.1
3+
rev: v18.1.8
44
hooks:
55
- id: clang-format
66
types_or: [file]
@@ -29,3 +29,11 @@ repos:
2929
name: Check taboo code patterns
3030
language: system
3131
entry: .github/check_taboos.sh
32+
33+
- repo: local
34+
hooks:
35+
- id: check_duplicate_cu_files
36+
name: Check duplicate .cu file names
37+
language: system
38+
entry: .github/check_duplicate_cu_files.sh
39+
pass_filenames: false

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
# Set up the project.
88
cmake_minimum_required( VERSION 3.25 )
9-
project( traccc VERSION 0.22.0 LANGUAGES CXX )
9+
project( traccc VERSION 0.24.0 LANGUAGES CXX )
1010

1111
# Set up the used C++ standard(s).
1212
set( CMAKE_CXX_STANDARD 20 CACHE STRING "The (host) C++ standard to use" )

CMakePresets.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,42 @@
8989
"TRACCC_BUILD_ALPAKA" : "TRUE"
9090
}
9191
},
92+
{
93+
"name" : "alpaka-fp32-cuda",
94+
"displayName" : "Alpaka CUDA FP32 Code Development",
95+
"inherits": ["alpaka-fp32", "cuda-fp32"],
96+
"cacheVariables": {
97+
"alpaka_ACC_GPU_CUDA_ENABLE" : "TRUE"
98+
}
99+
},
100+
{
101+
"name" : "alpaka-fp64-cuda",
102+
"displayName" : "Alpaka CUDA FP64 Code Development",
103+
"inherits": ["alpaka-fp64", "cuda-fp64"],
104+
"cacheVariables": {
105+
"alpaka_ACC_GPU_CUDA_ENABLE" : "TRUE"
106+
}
107+
},
108+
{
109+
"name": "alpaka-fp32-hip",
110+
"displayName": "Alpaka HIP FP32 Code Development",
111+
"inherits": ["alpaka-fp32"],
112+
"cacheVariables": {
113+
"alpaka_ACC_GPU_HIP_ENABLE" : "TRUE",
114+
"TRACCC_BUILD_HIP": "ON",
115+
"TRACCC_SETUP_ROCTHRUST": "ON"
116+
}
117+
},
118+
{
119+
"name": "alpaka-fp64-hip",
120+
"displayName": "Alpaka HIP FP64 Code Development",
121+
"inherits": ["alpaka-fp64"],
122+
"cacheVariables": {
123+
"alpaka_ACC_GPU_HIP_ENABLE" : "TRUE",
124+
"TRACCC_BUILD_HIP": "ON",
125+
"TRACCC_SETUP_ROCTHRUST": "ON"
126+
}
127+
},
92128
{
93129
"name" : "kokkos-fp32",
94130
"displayName" : "Kokkos FP32 Code Development",

README.md

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,17 @@ Demonstrator tracking chain for accelerators.
44

55
## Features
66

7-
| Category | Algorithms | CPU | CUDA | SYCL | Alpaka | Kokkos | Futhark |
8-
| ------------------ | ---------------------- | --- | ---- | ---- | ------ | ------ | ------- |
9-
| **Clusterization** | CCL / FastSv / etc. |||| 🟡 |||
10-
| | Measurement creation |||| 🟡 |||
11-
| **Seeding** | Spacepoint formation |||| 🟡 |||
12-
| | Spacepoint binning |||||||
13-
| | Seed finding |||||||
14-
| | Track param estimation |||||||
15-
| **Track finding** | Combinatorial KF |||| 🟡 |||
16-
| **Ambiguity resolution** | Greedy resolver || 🟡 | ||||
17-
| **Track fitting** | KF ||| 🟡 | |||
7+
| Category | Algorithms | CPU | CUDA | SYCL | Alpaka | Kokkos | Futhark |
8+
| ------------------------- | ---------------------- | --- | ---- | ---- | ------ | ------ | ------- |
9+
| **Clusterization** | CCL / FastSv / etc. |||| |||
10+
| | Measurement creation |||| |||
11+
| **Seeding** | Spacepoint formation |||| |||
12+
| | Spacepoint binning |||||||
13+
| | Seed finding |||||||
14+
| | Track param estimation |||||||
15+
| **Track finding** | Combinatorial KF |||| |||
16+
| **Ambiguity resolution** | Greedy resolver || 🟡 | ||||
17+
| **Track fitting** | KF ||| 🟡 | |||
1818

1919
✅: exists, 🟡: work started, ⚪: work not started yet
2020

@@ -272,7 +272,6 @@ cmake --build build/
272272
--detector-file=geometries/odd/odd-detray_geometry_detray.json \
273273
--material-file=geometries/odd/odd-detray_material_detray.json \
274274
--grid-file=geometries/odd/odd-detray_surface_grids_detray.json \
275-
--use-detray-detector \
276275
--digitization-file=geometries/odd/odd-digi-geometric-config.json \
277276
--use-acts-geom-source --input-directory=odd/geant4_10muon_10GeV/ \
278277
--input-events=10
@@ -281,7 +280,6 @@ cmake --build build/
281280
--detector-file=geometries/odd/odd-detray_geometry_detray.json \
282281
--material-file=geometries/odd/odd-detray_material_detray.json \
283282
--grid-file=geometries/odd/odd-detray_surface_grids_detray.json \
284-
--use-detray-detector \
285283
--digitization-file=geometries/odd/odd-digi-geometric-config.json \
286284
--use-acts-geom-source --input-directory=odd/geant4_10muon_10GeV/ \
287285
--input-events=10 --processed-events=1000 --threads=1

benchmarks/cpu/toy_detector_cpu.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717

1818
// Traccc IO include(s).
1919
#include "traccc/io/read_detector.hpp"
20-
#include "traccc/io/read_geometry.hpp"
2120
#include "traccc/io/read_measurements.hpp"
2221
#include "traccc/io/read_spacepoints.hpp"
2322

benchmarks/cuda/toy_detector_cuda.cpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
#include "traccc/fitting/kalman_filter/kalman_fitter.hpp"
1616
#include "traccc/geometry/detector.hpp"
1717
#include "traccc/io/read_detector.hpp"
18-
#include "traccc/io/read_geometry.hpp"
1918
#include "traccc/io/read_measurements.hpp"
2019
#include "traccc/io/read_spacepoints.hpp"
2120
#include "traccc/utils/propagation.hpp"
@@ -69,14 +68,10 @@ BENCHMARK_DEFINE_F(ToyDetectorBenchmark, CUDA)(benchmark::State& state) {
6968
async_copy, stream);
7069

7170
// Copy detector to device
72-
auto det_buffer = detray::get_buffer(det, device_mr, copy);
71+
const auto det_buffer = detray::get_buffer(det, device_mr, copy);
7372
// Detector view object
7473
auto det_view = detray::get_data(det_buffer);
7574

76-
// D2H copy object
77-
traccc::device::container_d2h_copy_alg<traccc::track_state_container_types>
78-
track_state_d2h{{device_mr, &host_mr}, copy};
79-
8075
for (auto _ : state) {
8176

8277
state.PauseTiming();
@@ -129,7 +124,7 @@ BENCHMARK_DEFINE_F(ToyDetectorBenchmark, CUDA)(benchmark::State& state) {
129124
params_cuda_buffer);
130125

131126
// Run track fitting
132-
traccc::track_state_container_types::buffer
127+
traccc::edm::track_fit_container<traccc::default_algebra>::buffer
133128
track_states_cuda_buffer = device_fitting(
134129
det_view, field,
135130
{track_candidates_cuda_buffer, measurements_cuda_buffer});

cmake/traccc-compiler-options-cuda.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ endif()
2525

2626
# Allow to use functions in device code that are constexpr, even if they are
2727
# not marked with __device__.
28-
traccc_add_flag( CMAKE_CUDA_FLAGS "--expt-relaxed-constexpr" )
28+
traccc_add_flag( CMAKE_CUDA_FLAGS "--expt-relaxed-constexpr --use_fast_math" )
2929

3030
# Make CUDA generate debug symbols for the device code as well in a debug
3131
# build.

core/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ traccc_add_library( traccc_core core TYPE SHARED
2121
"include/traccc/edm/details/device_container.hpp"
2222
"include/traccc/edm/details/host_container.hpp"
2323
"include/traccc/edm/measurement.hpp"
24+
"include/traccc/edm/measurement_helpers.hpp"
25+
"include/traccc/edm/impl/measurement_helpers.ipp"
2426
"include/traccc/edm/particle.hpp"
2527
"include/traccc/edm/track_parameters.hpp"
2628
"include/traccc/edm/container.hpp"
27-
"include/traccc/edm/track_state.hpp"
2829
"include/traccc/edm/silicon_cell_collection.hpp"
2930
"include/traccc/edm/impl/silicon_cell_collection.ipp"
3031
"include/traccc/edm/silicon_cluster_collection.hpp"
@@ -35,6 +36,12 @@ traccc_add_library( traccc_core core TYPE SHARED
3536
"include/traccc/edm/track_candidate_collection.hpp"
3637
"include/traccc/edm/impl/track_candidate_collection.ipp"
3738
"include/traccc/edm/track_candidate_container.hpp"
39+
"include/traccc/edm/track_state_collection.hpp"
40+
"include/traccc/edm/impl/track_state_collection.ipp"
41+
"include/traccc/edm/track_state_helpers.hpp"
42+
"include/traccc/edm/impl/track_state_helpers.ipp"
43+
"include/traccc/edm/track_fit_outcome.hpp"
44+
"include/traccc/edm/track_fit_collection.hpp"
3845
# Magnetic field description.
3946
"include/traccc/bfield/magnetic_field_types.hpp"
4047
"include/traccc/bfield/magnetic_field.hpp"

core/include/traccc/bfield/magnetic_field.hpp

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313

1414
// System include(s).
1515
#include <any>
16+
#include <sstream>
1617

1718
namespace traccc {
1819

@@ -64,12 +65,55 @@ class magnetic_field {
6465
template <covfie::concepts::field_backend bfield_backend_t>
6566
const covfie::field<bfield_backend_t>& as_field() const;
6667

68+
/// @brief Return type information about the contained magnetic field.
69+
const std::type_info& type() const { return m_field.type(); }
70+
6771
private:
6872
/// The actualy covfie b-field object
6973
std::any m_field;
7074

7175
}; // class magnetic_field
7276

77+
/// @brief Helper function for `bfield_visitor`
78+
template <typename callable_t, typename bfield_t, typename... bfield_ts>
79+
auto magnetic_field_visitor_helper(const magnetic_field& bfield,
80+
callable_t&& callable,
81+
std::tuple<bfield_t, bfield_ts...>*)
82+
requires(covfie::concepts::field_backend<bfield_t> &&
83+
(covfie::concepts::field_backend<bfield_ts> && ...))
84+
{
85+
if (bfield.is<bfield_t>()) {
86+
return callable(bfield.as_view<bfield_t>());
87+
} else {
88+
if constexpr (sizeof...(bfield_ts) > 0) {
89+
return magnetic_field_visitor_helper(
90+
bfield, std::forward<callable_t>(callable),
91+
static_cast<std::tuple<bfield_ts...>*>(nullptr));
92+
} else {
93+
std::stringstream exception_message;
94+
95+
exception_message
96+
<< "Invalid B-field type (" << bfield.type().name()
97+
<< ") received, but this type is not supported" << std::endl;
98+
99+
throw std::invalid_argument(exception_message.str());
100+
}
101+
}
102+
}
103+
104+
/// @brief Visitor for polymorphic magnetic field types
105+
///
106+
/// This function takes a list of supported magnetic field types and checks
107+
/// if the provided field is one of them. If it is, it will call the provided
108+
/// callable on a view of it and otherwise it will throw an exception.
109+
template <typename bfield_list_t, typename callable_t>
110+
auto magnetic_field_visitor(const magnetic_field& bfield,
111+
callable_t&& callable) {
112+
return magnetic_field_visitor_helper(bfield,
113+
std::forward<callable_t>(callable),
114+
static_cast<bfield_list_t*>(nullptr));
115+
}
116+
73117
} // namespace traccc
74118

75119
// Include the implementation.

0 commit comments

Comments
 (0)