ATLAS Offline Software
EFTrackingXrtAlgorithm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
5 #ifndef EFTRACKING_XRT_ALGORITHM
6 #define EFTRACKING_XRT_ALGORITHM
7 
8 #include <memory>
9 #include <map>
10 
13 #include "Gaudi/Property.h"
14 #include "Gaudi/Parsers/Factory.h"
15 
16 #include "GaudiKernel/ServiceHandle.h"
17 #include "GaudiKernel/IChronoSvc.h"
20 
21 #include "xrt/xrt_bo.h"
22 #include "xrt/xrt_device.h"
23 #include "xrt/xrt_kernel.h"
24 
36 {
43 
45  this,
46  "DeviceMgmtSvc",
47  "AthXRT::DeviceMgmtSvc",
48  "The XRT device manager service to use"
49  };
50 
52  this,
53  "ChronoStatSvc",
54  "ChronoStatSvc",
55  "Stop watch"
56  };
57 
58  Gaudi::Property<std::vector<std::tuple<std::string, std::string, int>>> m_inputInterfaces {
59  this,
60  "inputInterfaces",
61  {},
62  ""
63  };
64 
65  Gaudi::Property<std::vector<std::tuple<std::string, std::string, int>>> m_vSizeInterfaces {
66  this,
67  "vSizeInterfaces",
68  {},
69  ""
70  };
71 
72  Gaudi::Property<std::vector<std::tuple<std::string, std::string, int>>> m_outputInterfaces {
73  this,
74  "outputInterfaces",
75  {},
76  ""
77  };
78 
79  Gaudi::Property<std::vector<std::tuple<std::string, int, std::string, int>>> m_sharedInterfaces {
80  this,
81  "sharedInterfaces",
82  {},
83  ""
84  };
85 
86  Gaudi::Property<std::vector<std::vector<std::string>>> m_kernelOrder {
87  this,
88  "kernelOrder",
89  {},
90  ""
91  };
92 
93  Gaudi::Property<std::size_t> m_bufferSize {
94  this,
95  "bufferSize",
96  8192,
97  "Capacity of xrt buffers in terms of 64bit words."
98  };
99 
100  std::map<std::string, std::unique_ptr<xrt::kernel>> m_kernels{};
101  std::map<std::string, std::unique_ptr<xrt::run>> m_runs{};
102 
103  // Buffer objects
104  mutable std::vector<xrt::bo> m_inputBuffers ATLAS_THREAD_SAFE {};
105  mutable std::vector<xrt::bo> m_outputBuffers ATLAS_THREAD_SAFE {};
106 
107  public:
108  EFTrackingXrtAlgorithm(const std::string& name, ISvcLocator* pSvcLocator);
109  StatusCode initialize() override final;
110  StatusCode execute(const EventContext& ctx) const override final;
111 };
112 
113 #endif
114 
ReadHandleKeyArray.h
EFTrackingXrtAlgorithm::m_outputInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_outputInterfaces
Definition: EFTrackingXrtAlgorithm.h:72
EFTrackingXrtAlgorithm::EFTrackingXrtAlgorithm
EFTrackingXrtAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: EFTrackingXrtAlgorithm.cxx:9
SG::HandleKeyArray
Definition: StoreGate/StoreGate/HandleKeyArray.h:45
EFTrackingXrtAlgorithm
Definition: EFTrackingXrtAlgorithm.h:36
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
EFTrackingXrtAlgorithm::m_kernelOrder
Gaudi::Property< std::vector< std::vector< std::string > > > m_kernelOrder
Definition: EFTrackingXrtAlgorithm.h:86
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition: AthReentrantAlgorithm.h:74
EFTrackingXrtAlgorithm::m_vSizeInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_vSizeInterfaces
Definition: EFTrackingXrtAlgorithm.h:65
EFTrackingXrtAlgorithm::m_kernels
std::map< std::string, std::unique_ptr< xrt::kernel > > m_kernels
Definition: EFTrackingXrtAlgorithm.h:100
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EFTrackingXrtAlgorithm::m_inputDataStreamKeys
SG::ReadHandleKeyArray< std::vector< unsigned long > > m_inputDataStreamKeys
Keys to access encoded 64bit words following the EFTracking specification.
Definition: EFTrackingXrtAlgorithm.h:40
EFTrackingXrtAlgorithm::ATLAS_THREAD_SAFE
std::vector< xrt::bo > m_inputBuffers ATLAS_THREAD_SAFE
Definition: EFTrackingXrtAlgorithm.h:104
columnar::final
CM final
Definition: ColumnAccessor.h:106
EFTrackingXrtAlgorithm::m_DeviceMgmtSvc
ServiceHandle< AthXRT::IDeviceMgmtSvc > m_DeviceMgmtSvc
Definition: EFTrackingXrtAlgorithm.h:44
IDeviceMgmtSvc.h
EFTrackingXrtAlgorithm::m_inputInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, std::string, int > > > m_inputInterfaces
Definition: EFTrackingXrtAlgorithm.h:58
AthReentrantAlgorithm.h
WriteHandleKeyArray.h
EFTrackingXrtAlgorithm::execute
StatusCode execute(const EventContext &ctx) const override final
Definition: EFTrackingXrtAlgorithm.cxx:186
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
EFTrackingXrtAlgorithm::m_vSizeDataStreamKeys
SG::ReadHandleKeyArray< std::vector< unsigned long > > m_vSizeDataStreamKeys
Definition: EFTrackingXrtAlgorithm.h:41
EFTrackingXrtAlgorithm::m_sharedInterfaces
Gaudi::Property< std::vector< std::tuple< std::string, int, std::string, int > > > m_sharedInterfaces
Definition: EFTrackingXrtAlgorithm.h:79
EFTrackingXrtAlgorithm::initialize
StatusCode initialize() override final
Definition: EFTrackingXrtAlgorithm.cxx:15
EFTrackingXrtAlgorithm::m_bufferSize
Gaudi::Property< std::size_t > m_bufferSize
Definition: EFTrackingXrtAlgorithm.h:93
EFTrackingXrtAlgorithm::m_outputDataStreamKeys
SG::WriteHandleKeyArray< std::vector< unsigned long > > m_outputDataStreamKeys
Definition: EFTrackingXrtAlgorithm.h:42
EFTrackingXrtAlgorithm::m_runs
std::map< std::string, std::unique_ptr< xrt::run > > m_runs
Definition: EFTrackingXrtAlgorithm.h:101
ServiceHandle< AthXRT::IDeviceMgmtSvc >
EFTrackingXrtAlgorithm::m_chronoSvc
ServiceHandle< IChronoSvc > m_chronoSvc
Definition: EFTrackingXrtAlgorithm.h:51