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

Tool providing CUDA-based traccc spacepoint formation algorithm. More...

#include <CUDASPFormationAlgProviderTool.h>

Inheritance diagram for ActsTrk::CUDASPFormationAlgProviderTool:
Collaboration diagram for ActsTrk::CUDASPFormationAlgProviderTool:

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::silicon_pixel_spacepoint_formation_algorithm > > getPixelSPFormationAlgorithm (const EventContext &ctx) const override
 Function constructing the traccc cuda clusterization algorithm.

Private Attributes

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 spacepoint formation algorithm.

This tool constructs the traccc device spacepoint formation algorithm, configured to run on with CUDA backend. It relies on separate tools to provide the host/device memory resources and the vecmem copy object.

Currently only pixel spacepoint formation is implemented in Traccc

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

Definition at line 35 of file CUDASPFormationAlgProviderTool.h.

Member Function Documentation

◆ getPixelSPFormationAlgorithm()

std::pair< std::shared_ptr< const vecmem::copy >, std::shared_ptr< const traccc::device::silicon_pixel_spacepoint_formation_algorithm > > ActsTrk::CUDASPFormationAlgProviderTool::getPixelSPFormationAlgorithm ( const EventContext & ctx) const
overridevirtual

Function constructing the traccc cuda clusterization algorithm.

Returns
cuda spacepoint formation algorithm and vecmem copy object

Definition at line 25 of file CUDASPFormationAlgProviderTool.cxx.

26{
27
28 ATH_MSG_VERBOSE("Constructing CUDA traccc pixel spacepoint formation algorithm");
29 traccc::memory_resource mr{m_MRs->mainMR(), m_MRs->hostMR()};
30 auto copy = m_copy->copy(ctx);
31
32 return std::make_pair(copy, std::make_shared<traccc::cuda::silicon_pixel_spacepoint_formation_algorithm>(
33 mr,
34 *copy,
35 traccc::cuda::stream_wrapper{m_streamTool->stream(ctx)},
36 makeActsAthenaLogger(this, "TracccSPFormationCUDA")));
37
38}
#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

◆ initialize()

StatusCode ActsTrk::CUDASPFormationAlgProviderTool::initialize ( )
overridevirtual

Function initializing the algorithm.

Definition at line 12 of file CUDASPFormationAlgProviderTool.cxx.

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

Member Data Documentation

◆ m_copy

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

Definition at line 56 of file CUDASPFormationAlgProviderTool.h.

56 {
57 this, "CopyProviderTool", "", "Vecmem copy provider tool"};

◆ m_MRs

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

Definition at line 51 of file CUDASPFormationAlgProviderTool.h.

51 {
52 this, "MemoryResourcesTool", "",
53 "The memory resources tool to use for allocating memory on the device"};

◆ m_streamTool

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

Definition at line 59 of file CUDASPFormationAlgProviderTool.h.

59 {
60 this, "StreamTool", "", "CUDA stream provider tool"};

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