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

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

#include <HIPClusterizationAlgProviderTool.h>

Inheritance diagram for ActsTrk::HIPClusterizationAlgProviderTool:
Collaboration diagram for ActsTrk::HIPClusterizationAlgProviderTool:

Public Member Functions

virtual StatusCode initialize () override
 Function initializing the algorithm.
virtual DeviceAlgorithmT< traccc::device::clusterization_algorithm > getClusterizationAlgorithm (const EventContext &ctx) const override
 Function constructing the traccc hip clusterization algorithm.
virtual DeviceAlgorithmT< sorting_algorithm_type > getSortingAlgorithm (const EventContext &ctx) const override
 Function constructing the traccc hip 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::IMemoryResourcesTool > m_MRs
The device copy tool to use
ToolHandle< AthDevice::ICopyTool > m_copy
The hip stream provider tool
ToolHandle< AthHIP::IStreamTool > m_streamTool

Detailed Description

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

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

Definition at line 32 of file HIPClusterizationAlgProviderTool.h.

Member Function Documentation

◆ getClusterizationAlgorithm()

DeviceAlgorithmT< traccc::device::clusterization_algorithm > ActsTrk::HIPClusterizationAlgProviderTool::getClusterizationAlgorithm ( const EventContext & ctx) const
overridevirtual

Function constructing the traccc hip clusterization algorithm.

Returns
hip clusterization algorithm and vecmem copy object

Definition at line 31 of file HIPClusterizationAlgProviderTool.cxx.

32 {
33
34 ATH_MSG_VERBOSE("Constructing HIP traccc clusterization algorithm");
35 auto copy = m_copy->copy(ctx);
36
37 return {copy,
38 std::make_shared<traccc::hip::clusterization_algorithm>(
39 traccc::memory_resource{m_MRs->mainMR(), m_MRs->hostMR()}, *copy,
40 traccc::hip::stream_wrapper{m_streamTool->stream(ctx)},
42 makeActsAthenaLogger(this, "TracccClusterizationHIP"))};
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)
Definition Logger.cxx:64
ToolHandle< AthDevice::IMemoryResourcesTool > m_MRs
bool copy
Definition calibdata.py:26

◆ getSortingAlgorithm()

DeviceAlgorithmT< IDeviceClusterizationAlgProviderTool::sorting_algorithm_type > ActsTrk::HIPClusterizationAlgProviderTool::getSortingAlgorithm ( const EventContext & ctx) const
overridevirtual

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

Returns
hip measurement sorting algorithm and vecmem copy object

Definition at line 46 of file HIPClusterizationAlgProviderTool.cxx.

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

◆ initialize()

StatusCode ActsTrk::HIPClusterizationAlgProviderTool::initialize ( )
overridevirtual

Function initializing the algorithm.

Definition at line 17 of file HIPClusterizationAlgProviderTool.cxx.

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

Member Data Documentation

◆ m_clusteringConfig

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

Definition at line 51 of file HIPClusterizationAlgProviderTool.h.

51{};

◆ m_copy

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

Definition at line 64 of file HIPClusterizationAlgProviderTool.h.

64 {this, "CopyProviderTool", "",
65 "Vecmem copy provider tool"};

◆ m_MRs

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

Definition at line 59 of file HIPClusterizationAlgProviderTool.h.

59 {
60 this, "MemoryResourcesTool", "",
61 "The memory resources tool to use for allocating memory on the device"};

◆ m_sortCells

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

Definition at line 54 of file HIPClusterizationAlgProviderTool.h.

54 {
55 this, "CellSorting", true,
56 "Whether to sort traccc cells on GPU prior to clusterization"};

◆ m_streamTool

ToolHandle<AthHIP::IStreamTool> ActsTrk::HIPClusterizationAlgProviderTool::m_streamTool
private
Initial value:
{this, "StreamTool", "",
"HIP stream provider tool"}

Definition at line 67 of file HIPClusterizationAlgProviderTool.h.

67 {this, "StreamTool", "",
68 "HIP stream provider tool"};

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