ATLAS Offline Software
Loading...
Searching...
No Matches
ActsTrk::CUDAClusterizationAlgProviderTool Class Reference

Tool providing CUDA-based traccc clusterization and measurement sorting algorithms. More...

#include <CUDAClusterizationAlgProviderTool.h>

Inheritance diagram for ActsTrk::CUDAClusterizationAlgProviderTool:
Collaboration diagram for ActsTrk::CUDAClusterizationAlgProviderTool:

Public Member Functions

virtual StatusCode initialize () override
 Function initializing the algorithm.
virtual std::pair< std::shared_ptr< const vecmem::copy >, std::shared_ptr< const traccc::device::clusterization_algorithm > > getClusterizationAlgorithm (const EventContext &ctx) const override
 Function constructing the traccc cuda clusterization algorithm.
virtual std::pair< std::shared_ptr< const vecmem::copy >, std::shared_ptr< const IDeviceClusterizationAlgProviderTool::sorting_algorithm_type > > getSortingAlgorithm (const EventContext &ctx) const override
 Function constructing the traccc cuda measurement sorting algorithm Neccesary because the CKF requires measurements to be sorted by module ID.

Private Attributes

traccc::clustering_config m_clusteringConfig {}
Whether to sort traccc cells on GPU prior to clusterization
Gaudi::Property< bool > m_sortCells
The host and device memory resources tool to use for memory allocations
ToolHandle< AthDevice::IMemoryResourcesToolm_MRs
The device copy tool to use
ToolHandle< AthDevice::ICopyToolm_copy
The cuda stream provider tool
ToolHandle< AthCUDA::IStreamToolm_streamTool

Detailed Description

Tool providing CUDA-based traccc clusterization and measurement sorting algorithms.

This tool constructs the traccc device clusterization algorithm, configured to run on with CUDA backend. It relies on separate tools to provide the host/device memory resources, the vecmem copy object, and the CUDA stream used for asynchronous execution.

Author
Neža Ribarič neza..nosp@m.riba.nosp@m.ric@c.nosp@m.ern..nosp@m.ch

Definition at line 35 of file CUDAClusterizationAlgProviderTool.h.

Member Function Documentation

◆ getClusterizationAlgorithm()

std::pair< std::shared_ptr< const vecmem::copy >, std::shared_ptr< const traccc::device::clusterization_algorithm > > ActsTrk::CUDAClusterizationAlgProviderTool::getClusterizationAlgorithm ( const EventContext & ctx) const
overridevirtual

Function constructing the traccc cuda clusterization algorithm.

Returns
cuda clusterization algorithm and vecmem copy object

Definition at line 29 of file CUDAClusterizationAlgProviderTool.cxx.

30{
31
32 ATH_MSG_VERBOSE("Constructing CUDA traccc clusterization algorithm");
33 traccc::memory_resource mr{m_MRs->mainMR(), m_MRs->hostMR()};
34 auto copy = m_copy->copy(ctx);
35
36 return std::make_pair(copy, std::make_shared<traccc::cuda::clusterization_algorithm>(
37 mr,
38 *copy,
39 traccc::cuda::stream_wrapper{m_streamTool->stream(ctx)},
41 makeActsAthenaLogger(this, "TracccClusterizationCUDA")));
42
43}
#define ATH_MSG_VERBOSE(x)
std::unique_ptr< const Acts::Logger > makeActsAthenaLogger(IMessageSvc *svc, const std::string &name, int level, std::optional< std::string > parent_name)
ToolHandle< AthDevice::IMemoryResourcesTool > m_MRs
bool copy
Definition calibdata.py:26

◆ getSortingAlgorithm()

std::pair< std::shared_ptr< const vecmem::copy >, std::shared_ptr< const IDeviceClusterizationAlgProviderTool::sorting_algorithm_type > > ActsTrk::CUDAClusterizationAlgProviderTool::getSortingAlgorithm ( const EventContext & ctx) const
overridevirtual

Function constructing the traccc cuda measurement sorting algorithm Neccesary because the CKF requires measurements to be sorted by module ID.

Returns
cuda measurement sorting algorithm and vecmem copy object

Definition at line 46 of file CUDAClusterizationAlgProviderTool.cxx.

47{
48
49 ATH_MSG_VERBOSE("Constructing CUDA traccc measurement sorting algorithm");
50 traccc::memory_resource mr{m_MRs->mainMR(), m_MRs->hostMR()};
51 auto copy = m_copy->copy(ctx);
52
53 return std::make_pair(copy, std::make_shared<traccc::cuda::measurement_sorting_algorithm>(
54 mr,
55 *copy,
56 traccc::cuda::stream_wrapper{m_streamTool->stream(ctx)},
57 makeActsAthenaLogger(this, "TracccMeasurementSortingCUDA")));
58
59}

◆ initialize()

StatusCode ActsTrk::CUDAClusterizationAlgProviderTool::initialize ( )
overridevirtual

Function initializing the algorithm.

Definition at line 14 of file CUDAClusterizationAlgProviderTool.cxx.

15{
16 ATH_MSG_DEBUG("Initializing.");
17
18 ATH_CHECK(m_MRs.retrieve());
19 ATH_CHECK(m_copy.retrieve());
20 ATH_CHECK(m_streamTool.retrieve());
21
23
24 ATH_MSG_DEBUG("Successfully initialized");
25 return StatusCode::SUCCESS;
26}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)

Member Data Documentation

◆ m_clusteringConfig

traccc::clustering_config ActsTrk::CUDAClusterizationAlgProviderTool::m_clusteringConfig {}
private

Definition at line 56 of file CUDAClusterizationAlgProviderTool.h.

56{};

◆ m_copy

ToolHandle<AthDevice::ICopyTool> ActsTrk::CUDAClusterizationAlgProviderTool::m_copy
private
Initial value:
{
this, "CopyProviderTool", "", "Vecmem copy provider tool"}

Definition at line 67 of file CUDAClusterizationAlgProviderTool.h.

67 {
68 this, "CopyProviderTool", "", "Vecmem copy provider tool"};

◆ m_MRs

ToolHandle<AthDevice::IMemoryResourcesTool> ActsTrk::CUDAClusterizationAlgProviderTool::m_MRs
private
Initial value:
{
this, "MemoryResourcesTool", "",
"The memory resources tool to use for allocating memory on the device"}

Definition at line 62 of file CUDAClusterizationAlgProviderTool.h.

62 {
63 this, "MemoryResourcesTool", "",
64 "The memory resources tool to use for allocating memory on the device"};

◆ m_sortCells

Gaudi::Property<bool> ActsTrk::CUDAClusterizationAlgProviderTool::m_sortCells
private
Initial value:
{this, "CellSorting", true,
"Whether to sort traccc cells on GPU prior to clusterization"}

Definition at line 59 of file CUDAClusterizationAlgProviderTool.h.

59 {this, "CellSorting", true,
60 "Whether to sort traccc cells on GPU prior to clusterization"};

◆ m_streamTool

ToolHandle<AthCUDA::IStreamTool> ActsTrk::CUDAClusterizationAlgProviderTool::m_streamTool
private
Initial value:
{
this, "StreamTool", "", "CUDA stream provider tool"}

Definition at line 70 of file CUDAClusterizationAlgProviderTool.h.

70 {
71 this, "StreamTool", "", "CUDA stream provider tool"};

The documentation for this class was generated from the following files: