ATLAS Offline Software
F1X0IntegrationAlg.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
9 #ifndef EFTRACKING_FPGA_INTEGRATION_F1X0IntegrationAlg_H
10 #define EFTRACKING_FPGA_INTEGRATION_F1X0IntegrationAlg_H
11 
12 // EFTracking include
16 
17 // Athena include
20 #include "GaudiKernel/ServiceHandle.h"
21 #include "GaudiKernel/IChronoSvc.h"
24 
26 
28 {
36  {
37  public:
38  using IntegrationBase::IntegrationBase;
39  virtual StatusCode initialize() override final;
40  virtual StatusCode execute(const EventContext &ctx) const override final;
41  virtual StatusCode finalize() override final;
42 
43  private:
45 
46  SG::ReadHandleKey<std::vector<uint64_t>> m_FPGAPixelRDO{this, "FPGAEncodedPixelKey", "FPGAEncodedPixelRDOs", "Pixel RDO converted to FPGA format"};
47  SG::ReadHandleKey<std::vector<uint64_t>> m_FPGAStripRDO{this, "FPGAEncodedStripKey", "FPGAEncodedStripRDOs", "Strip RDO converted to FPGA format"};
48 
49  SG::WriteHandleKey<std::vector<uint64_t>> m_FPGAPixelOutput{this, "FPGAOutputPixelKey", "FPGAPixelOutput", "Pixel output from FPGA format"};
50  SG::WriteHandleKey<std::vector<uint64_t>> m_FPGAStripOutput{this, "FPGAOutputStripKey", "FPGAStripOutput", "Strip output from FPGA format"};
51 
52  Gaudi::Property<int> m_FPGAThreads{this, "FPGAThreads", 1, "number of FPGA threads to initialize"};
53 
54  Gaudi::Property<std::string> m_xclbin{
55  this, "xclbin", "", "xclbin path and name"};
56 
57  Gaudi::Property<bool> m_doF110{
58  this, "doF110", "", "Run F110 instead of F100"};
59 
60  Gaudi::Property<std::string> m_pixelEdmKernelName{
61  this, "PixelEDMPrepKernelName", "", "Name of the FPGA kernel"};
62 
63  Gaudi::Property<std::string> m_stripEdmKernelName{
64  this, "StripEDMPrepKernelName", "", "Name of the FPGA kernel"};
65 
66  Gaudi::Property<std::string> m_pixelClusterKernelName{
67  this, "PixelClusterKernelName", "", "Name of the pixel clustering kernel"};
68 
69  Gaudi::Property<std::string> m_stripClusterKernelName{
70  this, "StripClusterKernelName", "", "Name of the strip clustering kernel"};
71 
72  Gaudi::Property<std::string> m_pixelL2GKernelName{
73  this, "PixelL2GKernelName", "", "Name of the pixel L2G kernel"};
74 
75  Gaudi::Property<std::string> m_stripL2GKernelName{
76  this, "StripL2GKernelName", "", "Name of the strip L2G kernel"};
77 
78  ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
79 
80  mutable std::atomic<ulonglong> m_numEvents{0};
81  mutable std::atomic<cl_ulong> m_pixelInputTime{0};
82  mutable std::atomic<cl_ulong> m_stripInputTime{0};
83  mutable std::atomic<cl_ulong> m_pixelClusteringTime{0};
84  mutable std::atomic<cl_ulong> m_stripClusteringTime{0};
85  mutable std::atomic<cl_ulong> m_pixelL2GTime{0};
86  mutable std::atomic<cl_ulong> m_stripL2GTime{0};
87  mutable std::atomic<cl_ulong> m_edmPrepTime{0};
88  mutable std::atomic<cl_ulong> m_pixelEdmPrepTime{0};
89  mutable std::atomic<cl_ulong> m_stripEdmPrepTime{0};
90  mutable std::atomic<cl_ulong> m_pixelOutputTime{0};
91  mutable std::atomic<cl_ulong> m_stripOutputTime{0};
92  mutable std::atomic<cl_ulong> m_kernelTime{0};
93 
94  // Kernels
95  // Clustering
96  mutable std::vector<cl::Kernel> m_pixelClusteringKernels ATLAS_THREAD_SAFE;
97  mutable std::vector<cl::Kernel> m_stripClusteringKernels ATLAS_THREAD_SAFE;
98 
99  // L2G
100  mutable std::vector<cl::Kernel> m_pixelL2GKernels ATLAS_THREAD_SAFE;
101  mutable std::vector<cl::Kernel> m_stripL2GKernels ATLAS_THREAD_SAFE;
102 
103  // EDM prep
104  mutable std::vector<cl::Kernel> m_pixelEdmPrepKernels ATLAS_THREAD_SAFE;
105  mutable std::vector<cl::Kernel> m_stripEdmPrepKernels ATLAS_THREAD_SAFE;
106 
107  // Buffers for input
108  std::vector<cl::Buffer> m_pixelClusterInputBufferList;
109  std::vector<cl::Buffer> m_stripClusterInputBufferList;
110  // Buffers for Clustering
111  std::vector<cl::Buffer> m_pixelClusterOutputBufferList;
112  std::vector<cl::Buffer> m_stripClusterOutputBufferList;
113  std::vector<cl::Buffer> m_pixelClusterEDMOutputBufferList;
114  std::vector<cl::Buffer> m_stripClusterEDMOutputBufferList;
115  // L2G
116  std::vector<cl::Buffer> m_pixelL2GOutputBufferList;
117  std::vector<cl::Buffer> m_stripL2GOutputBufferList;
118  std::vector<cl::Buffer> m_pixelL2GEDMOutputBufferList;
119  std::vector<cl::Buffer> m_stripL2GEDMOutputBufferList;
120  // EDMPrep
121  std::vector<cl::Buffer> m_edmPixelOutputBufferList;
122  std::vector<cl::Buffer> m_edmStripOutputBufferList;
123 
124  // Command queue
125  std::vector<cl::CommandQueue> m_acc_queues;
126  void getListofCUs(std::vector<std::string>& cuNames);
127 
128 
129  };
130 }
131 
132 #endif // EFTRACKING_FPGA_INTEGRATION_F1X0IntegrationAlg_H
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_xclbin
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
Definition: F1X0IntegrationAlg.h:54
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_kernelTime
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
Definition: F1X0IntegrationAlg.h:92
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusterKernelName
Gaudi::Property< std::string > m_pixelClusterKernelName
Name of the pixel clustering kernel.
Definition: F1X0IntegrationAlg.h:66
IRegSelTool.h
IntegrationBase
The base class for the EFTracking FPGA integration development.
Definition: IntegrationBase.h:38
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_edmPixelOutputBufferList
std::vector< cl::Buffer > m_edmPixelOutputBufferList
Definition: F1X0IntegrationAlg.h:121
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_doF110
Gaudi::Property< bool > m_doF110
Boolean to run F110 instead of F100.
Definition: F1X0IntegrationAlg.h:57
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_pixelClusteringKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:96
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelEdmPrepTime
std::atomic< cl_ulong > m_pixelEdmPrepTime
Time for pixel EDM preparation.
Definition: F1X0IntegrationAlg.h:88
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusterKernelName
Gaudi::Property< std::string > m_stripClusterKernelName
Name of the strip clustering kernel.
Definition: F1X0IntegrationAlg.h:69
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusterInputBufferList
std::vector< cl::Buffer > m_stripClusterInputBufferList
Definition: F1X0IntegrationAlg.h:109
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelInputTime
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
Definition: F1X0IntegrationAlg.h:81
EFTrackingFPGAIntegration::F1X0IntegrationAlg::finalize
virtual StatusCode finalize() override final
Definition: F1X0IntegrationAlg.cxx:357
EFTrackingFPGAIntegration::F1X0IntegrationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
Definition: F1X0IntegrationAlg.cxx:129
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_acc_queues
std::vector< cl::CommandQueue > m_acc_queues
Definition: F1X0IntegrationAlg.h:125
EFTrackingFPGAIntegration::F1X0IntegrationAlg
This is the class for the benchmark algorithm specific to the FPGA integration and output conversion.
Definition: F1X0IntegrationAlg.h:36
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelL2GEDMOutputBufferList
std::vector< cl::Buffer > m_pixelL2GEDMOutputBufferList
Definition: F1X0IntegrationAlg.h:118
EFTrackingFPGAIntegration::F1X0IntegrationAlg::getListofCUs
void getListofCUs(std::vector< std::string > &cuNames)
Definition: F1X0IntegrationAlg.cxx:386
IntegrationBase.h
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripClusteringKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:97
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripL2GKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:101
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelL2GOutputBufferList
std::vector< cl::Buffer > m_pixelL2GOutputBufferList
Definition: F1X0IntegrationAlg.h:116
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GEDMOutputBufferList
std::vector< cl::Buffer > m_stripL2GEDMOutputBufferList
Definition: F1X0IntegrationAlg.h:119
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GKernelName
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
Definition: F1X0IntegrationAlg.h:75
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripEdmPrepKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:105
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusterOutputBufferList
std::vector< cl::Buffer > m_pixelClusterOutputBufferList
Definition: F1X0IntegrationAlg.h:111
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripEdmPrepTime
std::atomic< cl_ulong > m_stripEdmPrepTime
Time for strip EDM preparation.
Definition: F1X0IntegrationAlg.h:89
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GTime
std::atomic< cl_ulong > m_stripL2GTime
Time for strip L2G.
Definition: F1X0IntegrationAlg.h:86
SCT_RDO_Container.h
SG::WriteHandleKey
Property holding a SG store/key/clid from which a WriteHandle is made.
Definition: StoreGate/StoreGate/WriteHandleKey.h:40
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_pixelL2GKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:100
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusterEDMOutputBufferList
std::vector< cl::Buffer > m_stripClusterEDMOutputBufferList
Definition: F1X0IntegrationAlg.h:114
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GOutputBufferList
std::vector< cl::Buffer > m_stripL2GOutputBufferList
Definition: F1X0IntegrationAlg.h:117
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAPixelOutput
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGAPixelOutput
Definition: F1X0IntegrationAlg.h:49
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelEdmKernelName
Gaudi::Property< std::string > m_pixelEdmKernelName
Name of the FPGA kernel.
Definition: F1X0IntegrationAlg.h:60
EFTrackingFPGAIntegration
The class for enconding RDO to FPGA format.
Definition: BenchmarkAlg.h:28
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusterEDMOutputBufferList
std::vector< cl::Buffer > m_pixelClusterEDMOutputBufferList
Definition: F1X0IntegrationAlg.h:113
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAPixelRDO
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAPixelRDO
Definition: F1X0IntegrationAlg.h:46
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripInputTime
std::atomic< cl_ulong > m_stripInputTime
Time for strip input buffer write.
Definition: F1X0IntegrationAlg.h:82
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusteringTime
std::atomic< cl_ulong > m_stripClusteringTime
Time for strip clustering.
Definition: F1X0IntegrationAlg.h:84
EFTrackingTransient.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelL2GTime
std::atomic< cl_ulong > m_pixelL2GTime
Time for pixel L2G.
Definition: F1X0IntegrationAlg.h:85
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_edmPrepTime
std::atomic< cl_ulong > m_edmPrepTime
Time for EDM preparation.
Definition: F1X0IntegrationAlg.h:87
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusterInputBufferList
std::vector< cl::Buffer > m_pixelClusterInputBufferList
Definition: F1X0IntegrationAlg.h:108
PixelRDO_Container.h
xAODClusterMaker.h
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: F1X0IntegrationAlg.h:78
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripEdmKernelName
Gaudi::Property< std::string > m_stripEdmKernelName
Name of the FPGA kernel.
Definition: F1X0IntegrationAlg.h:63
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAThreads
Gaudi::Property< int > m_FPGAThreads
Definition: F1X0IntegrationAlg.h:52
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelL2GKernelName
Gaudi::Property< std::string > m_pixelL2GKernelName
Name of the pixel L2G kernel.
Definition: F1X0IntegrationAlg.h:72
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelOutputTime
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
Definition: F1X0IntegrationAlg.h:90
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_chronoSvc
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
Definition: F1X0IntegrationAlg.h:44
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAStripOutput
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGAStripOutput
Definition: F1X0IntegrationAlg.h:50
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAStripRDO
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAStripRDO
Definition: F1X0IntegrationAlg.h:47
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_pixelEdmPrepKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:104
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_numEvents
std::atomic< ulonglong > m_numEvents
Number of events processed.
Definition: F1X0IntegrationAlg.h:80
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripOutputTime
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
Definition: F1X0IntegrationAlg.h:91
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_edmStripOutputBufferList
std::vector< cl::Buffer > m_edmStripOutputBufferList
Definition: F1X0IntegrationAlg.h:122
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusterOutputBufferList
std::vector< cl::Buffer > m_stripClusterOutputBufferList
Definition: F1X0IntegrationAlg.h:112
TrigRoiDescriptorCollection.h
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusteringTime
std::atomic< cl_ulong > m_pixelClusteringTime
Time for pixel clustering.
Definition: F1X0IntegrationAlg.h:83
EFTrackingFPGAIntegration::F1X0IntegrationAlg::initialize
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
Definition: F1X0IntegrationAlg.cxx:15
ServiceHandle< IChronoSvc >