Skip to content

Commit

Permalink
Merge pull request #474 from beomki-yeo/async-cuda-track-finding
Browse files Browse the repository at this point in the history
Asynchronous CUDA finding and fitting
  • Loading branch information
beomki-yeo authored Oct 31, 2023
2 parents d778a20 + e578cc3 commit d3252a6
Show file tree
Hide file tree
Showing 8 changed files with 149 additions and 125 deletions.
17 changes: 11 additions & 6 deletions device/cuda/include/traccc/cuda/finding/finding_algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

// Project include(s).
#include "traccc/cuda/utils/stream.hpp"
#include "traccc/definitions/qualifiers.hpp"
#include "traccc/edm/measurement.hpp"
#include "traccc/edm/track_candidate.hpp"
Expand Down Expand Up @@ -77,8 +78,10 @@ class finding_algorithm
///
/// @param cfg Configuration object
/// @param mr The memory resource to use
finding_algorithm(const config_type& cfg,
const traccc::memory_resource& mr);
/// @param copy Copy object
/// @param str Cuda stream object
finding_algorithm(const config_type& cfg, const traccc::memory_resource& mr,
vecmem::copy& copy, stream& str);

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

private:
/// Memory resource used by the algorithm
traccc::memory_resource m_mr;
/// Copy object used by the algorithm
std::unique_ptr<vecmem::copy> m_copy;
/// Config object
config_type m_cfg;
/// Memory resource used by the algorithm
traccc::memory_resource m_mr;
/// The copy object to use
vecmem::copy& m_copy;
/// The CUDA stream to use
stream& m_stream;
};

} // namespace traccc::cuda
16 changes: 11 additions & 5 deletions device/cuda/include/traccc/cuda/fitting/fitting_algorithm.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#pragma once

// Project include(s).
#include "traccc/cuda/utils/stream.hpp"
#include "traccc/edm/track_candidate.hpp"
#include "traccc/edm/track_state.hpp"
#include "traccc/fitting/fitting_config.hpp"
Expand Down Expand Up @@ -40,9 +41,12 @@ class fitting_algorithm

/// Constructor for the fitting algorithm
///
/// @param mr The memory resource to use
fitting_algorithm(const config_type& cfg,
const traccc::memory_resource& mr);
/// @param cfg Configuration object
/// @param mr The memory resource to use
/// @param copy Copy object
/// @param str Cuda stream object
fitting_algorithm(const config_type& cfg, const traccc::memory_resource& mr,
vecmem::copy& copy, stream& str);

/// Run the algorithm
track_state_container_types::buffer operator()(
Expand All @@ -58,8 +62,10 @@ class fitting_algorithm
config_type m_cfg;
/// Memory resource used by the algorithm
traccc::memory_resource m_mr;
/// Copy object used by the algorithm
std::unique_ptr<vecmem::copy> m_copy;
/// The copy object to use
vecmem::copy& m_copy;
/// The CUDA stream to use
stream& m_stream;
};

} // namespace traccc::cuda
Loading

0 comments on commit d3252a6

Please sign in to comment.