Skip to content

Commit d3252a6

Browse files
authored
Merge pull request #474 from beomki-yeo/async-cuda-track-finding
Asynchronous CUDA finding and fitting
2 parents d778a20 + e578cc3 commit d3252a6

File tree

8 files changed

+149
-125
lines changed

8 files changed

+149
-125
lines changed

device/cuda/include/traccc/cuda/finding/finding_algorithm.hpp

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

1010
// Project include(s).
11+
#include "traccc/cuda/utils/stream.hpp"
1112
#include "traccc/definitions/qualifiers.hpp"
1213
#include "traccc/edm/measurement.hpp"
1314
#include "traccc/edm/track_candidate.hpp"
@@ -77,8 +78,10 @@ class finding_algorithm
7778
///
7879
/// @param cfg Configuration object
7980
/// @param mr The memory resource to use
80-
finding_algorithm(const config_type& cfg,
81-
const traccc::memory_resource& mr);
81+
/// @param copy Copy object
82+
/// @param str Cuda stream object
83+
finding_algorithm(const config_type& cfg, const traccc::memory_resource& mr,
84+
vecmem::copy& copy, stream& str);
8285

8386
/// Get config object (const access)
8487
const finding_config<scalar_type>& get_config() const { return m_cfg; }
@@ -98,12 +101,14 @@ class finding_algorithm
98101
const override;
99102

100103
private:
101-
/// Memory resource used by the algorithm
102-
traccc::memory_resource m_mr;
103-
/// Copy object used by the algorithm
104-
std::unique_ptr<vecmem::copy> m_copy;
105104
/// Config object
106105
config_type m_cfg;
106+
/// Memory resource used by the algorithm
107+
traccc::memory_resource m_mr;
108+
/// The copy object to use
109+
vecmem::copy& m_copy;
110+
/// The CUDA stream to use
111+
stream& m_stream;
107112
};
108113

109114
} // namespace traccc::cuda

device/cuda/include/traccc/cuda/fitting/fitting_algorithm.hpp

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

1010
// Project include(s).
11+
#include "traccc/cuda/utils/stream.hpp"
1112
#include "traccc/edm/track_candidate.hpp"
1213
#include "traccc/edm/track_state.hpp"
1314
#include "traccc/fitting/fitting_config.hpp"
@@ -40,9 +41,12 @@ class fitting_algorithm
4041

4142
/// Constructor for the fitting algorithm
4243
///
43-
/// @param mr The memory resource to use
44-
fitting_algorithm(const config_type& cfg,
45-
const traccc::memory_resource& mr);
44+
/// @param cfg Configuration object
45+
/// @param mr The memory resource to use
46+
/// @param copy Copy object
47+
/// @param str Cuda stream object
48+
fitting_algorithm(const config_type& cfg, const traccc::memory_resource& mr,
49+
vecmem::copy& copy, stream& str);
4650

4751
/// Run the algorithm
4852
track_state_container_types::buffer operator()(
@@ -58,8 +62,10 @@ class fitting_algorithm
5862
config_type m_cfg;
5963
/// Memory resource used by the algorithm
6064
traccc::memory_resource m_mr;
61-
/// Copy object used by the algorithm
62-
std::unique_ptr<vecmem::copy> m_copy;
65+
/// The copy object to use
66+
vecmem::copy& m_copy;
67+
/// The CUDA stream to use
68+
stream& m_stream;
6369
};
6470

6571
} // namespace traccc::cuda

0 commit comments

Comments
 (0)