ATLAS Offline Software
Loading...
Searching...
No Matches
CUDAClusterizationAlgProviderTool.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
5
6#include "traccc/clusterization/clusterization_algorithm.hpp"
7#include "traccc/cuda/clusterization/clusterization_algorithm.hpp"
8#include "traccc/cuda/clusterization/measurement_sorting_algorithm.hpp"
9
10#include "ActsInterop/Logger.h"
11
12namespace ActsTrk {
13
15{
16 ATH_MSG_DEBUG("Initializing.");
17
18 ATH_CHECK(m_hostMR.retrieve());
19 ATH_CHECK(m_deviceMR.retrieve());
20 ATH_CHECK(m_copy.retrieve());
21 ATH_CHECK(m_streamTool.retrieve());
22
23 ATH_MSG_DEBUG("Successfully initialized");
24 return StatusCode::SUCCESS;
25}
26
28{
29 ATH_MSG_DEBUG("Finalizing.");
30 return StatusCode::SUCCESS;
31}
32
33std::pair<std::shared_ptr<const vecmem::copy>, std::shared_ptr<const traccc::device::clusterization_algorithm>>
35{
36
37 ATH_MSG_VERBOSE("Constructing CUDA traccc clusterization algorithm");
38 traccc::memory_resource mr{m_deviceMR->mr(), &m_hostMR->mr()};
39 auto copy = m_copy->copy(ctx);
40
41 return std::make_pair(copy, std::make_shared<traccc::cuda::clusterization_algorithm>(
42 mr,
43 *copy,
44 traccc::cuda::stream_wrapper{m_streamTool->stream(ctx)},
46 makeActsAthenaLogger(this, "TracccClusterizationCUDA")));
47
48}
49
50std::pair<std::shared_ptr<const vecmem::copy>, std::shared_ptr<const IDeviceClusterizationAlgProviderTool::sorting_algorithm_type>>
52{
53
54 ATH_MSG_VERBOSE("Constructing CUDA traccc measurement sorting algorithm");
55 traccc::memory_resource mr{m_deviceMR->mr(), &m_hostMR->mr()};
56 auto copy = m_copy->copy(ctx);
57
58 return std::make_pair(copy, std::make_shared<traccc::cuda::measurement_sorting_algorithm>(
59 mr,
60 *copy,
61 traccc::cuda::stream_wrapper{m_streamTool->stream(ctx)},
62 makeActsAthenaLogger(this, "TracccMeasurementSortingCUDA")));
63
64}
65
66} // namespace ActsTrk
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_VERBOSE(x)
#define ATH_MSG_DEBUG(x)
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
ToolHandle< AthDevice::IMemoryResourceTool > m_hostMR
virtual std::pair< std::shared_ptr< const vecmem::copy >, std::shared_ptr< const traccc::device::clusterization_algorithm > > getClusterizationAlgorithm(const EventContext &ctx) const override
virtual std::pair< std::shared_ptr< const vecmem::copy >, std::shared_ptr< const IDeviceClusterizationAlgProviderTool::sorting_algorithm_type > > getSortingAlgorithm(const EventContext &ctx) const override
ToolHandle< AthDevice::IMemoryResourceTool > m_deviceMR
The AlignStoreProviderAlg loads the rigid alignment corrections and pipes them through the readout ge...