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<uint32_t>> m_FPGAPixelOutput{this, "FPGAOutputPixelKey", "FPGAPixelOutput", "Pixel output from FPGA format"};
50  SG::WriteHandleKey<std::vector<uint32_t>> m_FPGAStripOutput{this, "FPGAOutputStripKey", "FPGAStripOutput", "Strip output from FPGA format"};
51 
52  SG::ReadHandleKey<int> m_FPGAPixelRDOSize{this, "FPGAEncodedPixelSizeKey", "FPGAEncodedPixelSizeRDOs", "Size of the Pixel RDO converted to FPGA format"};
53  SG::ReadHandleKey<int> m_FPGAStripRDOSize{this, "FPGAEncodedStripSizeKey", "FPGAEncodedStripSizeRDOs", "Size of the Strip RDO converted to FPGA format"};
54 
55 
56  Gaudi::Property<int> m_FPGAThreads{this, "FPGAThreads", 1, "number of FPGA threads to initialize"};
57 
58  Gaudi::Property<std::string> m_xclbin{
59  this, "xclbin", "", "xclbin path and name"};
60 
61  Gaudi::Property<bool> m_doF110{
62  this, "doF110", "", "Run F110 instead of F100"};
63 
64  Gaudi::Property<std::string> m_pixelEdmKernelName{
65  this, "PixelEDMPrepKernelName", "", "Name of the FPGA kernel"};
66 
67  Gaudi::Property<std::string> m_stripEdmKernelName{
68  this, "StripEDMPrepKernelName", "", "Name of the FPGA kernel"};
69 
70  Gaudi::Property<std::string> m_pixelClusterKernelName{
71  this, "PixelClusterKernelName", "", "Name of the pixel clustering kernel"};
72 
73  Gaudi::Property<std::string> m_stripClusterKernelName{
74  this, "StripClusterKernelName", "", "Name of the strip clustering kernel"};
75 
76  Gaudi::Property<std::string> m_pixelL2GKernelName{
77  this, "PixelL2GKernelName", "", "Name of the pixel L2G kernel"};
78 
79  Gaudi::Property<std::string> m_stripL2GKernelName{
80  this, "StripL2GKernelName", "", "Name of the strip L2G kernel"};
81 
82  ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
83 
84  mutable std::atomic<ulonglong> m_numEvents{0};
85  mutable std::atomic<cl_ulong> m_pixelInputTime{0};
86  mutable std::atomic<cl_ulong> m_stripInputTime{0};
87  mutable std::atomic<cl_ulong> m_pixelClusteringTime{0};
88  mutable std::atomic<cl_ulong> m_stripClusteringTime{0};
89  mutable std::atomic<cl_ulong> m_pixelL2GTime{0};
90  mutable std::atomic<cl_ulong> m_stripL2GTime{0};
91  mutable std::atomic<cl_ulong> m_edmPrepTime{0};
92  mutable std::atomic<cl_ulong> m_pixelEdmPrepTime{0};
93  mutable std::atomic<cl_ulong> m_stripEdmPrepTime{0};
94  mutable std::atomic<cl_ulong> m_pixelOutputTime{0};
95  mutable std::atomic<cl_ulong> m_stripOutputTime{0};
96  mutable std::atomic<cl_ulong> m_kernelTime{0};
97 
98  // Kernels
99  // Clustering
100  mutable std::vector<cl::Kernel> m_pixelClusteringKernels ATLAS_THREAD_SAFE;
101  mutable std::vector<cl::Kernel> m_stripClusteringKernels ATLAS_THREAD_SAFE;
102 
103  // L2G
104  mutable std::vector<cl::Kernel> m_pixelL2GKernels ATLAS_THREAD_SAFE;
105  mutable std::vector<cl::Kernel> m_stripL2GKernels ATLAS_THREAD_SAFE;
106 
107  // EDM prep
108  mutable std::vector<cl::Kernel> m_pixelEdmPrepKernels ATLAS_THREAD_SAFE;
109  mutable std::vector<cl::Kernel> m_stripEdmPrepKernels ATLAS_THREAD_SAFE;
110 
111  // Buffers for input
112  std::vector<cl::Buffer> m_pixelClusterInputBufferList;
113  std::vector<cl::Buffer> m_stripClusterInputBufferList;
114  // Buffers for Clustering
115  std::vector<cl::Buffer> m_pixelClusterOutputBufferList;
116  std::vector<cl::Buffer> m_stripClusterOutputBufferList;
117  std::vector<cl::Buffer> m_pixelClusterEDMOutputBufferList;
118  std::vector<cl::Buffer> m_stripClusterEDMOutputBufferList;
119  // L2G
120  std::vector<cl::Buffer> m_pixelL2GOutputBufferList;
121  std::vector<cl::Buffer> m_stripL2GOutputBufferList;
122  std::vector<cl::Buffer> m_pixelL2GEDMOutputBufferList;
123  std::vector<cl::Buffer> m_stripL2GEDMOutputBufferList;
124  // EDMPrep
125  std::vector<cl::Buffer> m_edmPixelOutputBufferList;
126  std::vector<cl::Buffer> m_edmStripOutputBufferList;
127 
128  // Command queue
129  std::vector<cl::CommandQueue> m_acc_queues;
130  void getListofCUs(std::vector<std::string>& cuNames);
131 
132 
133  };
134 }
135 
136 #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:58
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_kernelTime
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
Definition: F1X0IntegrationAlg.h:96
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusterKernelName
Gaudi::Property< std::string > m_pixelClusterKernelName
Name of the pixel clustering kernel.
Definition: F1X0IntegrationAlg.h:70
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:125
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_doF110
Gaudi::Property< bool > m_doF110
Boolean to run F110 instead of F100.
Definition: F1X0IntegrationAlg.h:61
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_pixelClusteringKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:100
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelEdmPrepTime
std::atomic< cl_ulong > m_pixelEdmPrepTime
Time for pixel EDM preparation.
Definition: F1X0IntegrationAlg.h:92
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusterKernelName
Gaudi::Property< std::string > m_stripClusterKernelName
Name of the strip clustering kernel.
Definition: F1X0IntegrationAlg.h:73
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusterInputBufferList
std::vector< cl::Buffer > m_stripClusterInputBufferList
Definition: F1X0IntegrationAlg.h:113
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelInputTime
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
Definition: F1X0IntegrationAlg.h:85
EFTrackingFPGAIntegration::F1X0IntegrationAlg::finalize
virtual StatusCode finalize() override final
Definition: F1X0IntegrationAlg.cxx:361
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:131
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_acc_queues
std::vector< cl::CommandQueue > m_acc_queues
Definition: F1X0IntegrationAlg.h:129
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:122
EFTrackingFPGAIntegration::F1X0IntegrationAlg::getListofCUs
void getListofCUs(std::vector< std::string > &cuNames)
Definition: F1X0IntegrationAlg.cxx:390
IntegrationBase.h
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripClusteringKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:101
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAPixelOutput
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAPixelOutput
Definition: F1X0IntegrationAlg.h:49
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:105
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelL2GOutputBufferList
std::vector< cl::Buffer > m_pixelL2GOutputBufferList
Definition: F1X0IntegrationAlg.h:120
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GEDMOutputBufferList
std::vector< cl::Buffer > m_stripL2GEDMOutputBufferList
Definition: F1X0IntegrationAlg.h:123
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GKernelName
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
Definition: F1X0IntegrationAlg.h:79
EFTrackingFPGAIntegration::F1X0IntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripEdmPrepKernels ATLAS_THREAD_SAFE
Definition: F1X0IntegrationAlg.h:109
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusterOutputBufferList
std::vector< cl::Buffer > m_pixelClusterOutputBufferList
Definition: F1X0IntegrationAlg.h:115
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripEdmPrepTime
std::atomic< cl_ulong > m_stripEdmPrepTime
Time for strip EDM preparation.
Definition: F1X0IntegrationAlg.h:93
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GTime
std::atomic< cl_ulong > m_stripL2GTime
Time for strip L2G.
Definition: F1X0IntegrationAlg.h:90
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:104
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:118
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAPixelRDOSize
SG::ReadHandleKey< int > m_FPGAPixelRDOSize
Definition: F1X0IntegrationAlg.h:52
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripL2GOutputBufferList
std::vector< cl::Buffer > m_stripL2GOutputBufferList
Definition: F1X0IntegrationAlg.h:121
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelEdmKernelName
Gaudi::Property< std::string > m_pixelEdmKernelName
Name of the FPGA kernel.
Definition: F1X0IntegrationAlg.h:64
EFTrackingFPGAIntegration
The class for enconding RDO to FPGA format.
Definition: F100DataEncodingAlg.h:27
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:117
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:86
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusteringTime
std::atomic< cl_ulong > m_stripClusteringTime
Time for strip clustering.
Definition: F1X0IntegrationAlg.h:88
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:89
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_edmPrepTime
std::atomic< cl_ulong > m_edmPrepTime
Time for EDM preparation.
Definition: F1X0IntegrationAlg.h:91
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusterInputBufferList
std::vector< cl::Buffer > m_pixelClusterInputBufferList
Definition: F1X0IntegrationAlg.h:112
PixelRDO_Container.h
xAODClusterMaker.h
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_monTool
ToolHandle< GenericMonitoringTool > m_monTool
Definition: F1X0IntegrationAlg.h:82
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripEdmKernelName
Gaudi::Property< std::string > m_stripEdmKernelName
Name of the FPGA kernel.
Definition: F1X0IntegrationAlg.h:67
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAStripOutput
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAStripOutput
Definition: F1X0IntegrationAlg.h:50
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAThreads
Gaudi::Property< int > m_FPGAThreads
Definition: F1X0IntegrationAlg.h:56
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelL2GKernelName
Gaudi::Property< std::string > m_pixelL2GKernelName
Name of the pixel L2G kernel.
Definition: F1X0IntegrationAlg.h:76
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelOutputTime
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
Definition: F1X0IntegrationAlg.h:94
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_chronoSvc
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
Definition: F1X0IntegrationAlg.h:44
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:108
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_numEvents
std::atomic< ulonglong > m_numEvents
Number of events processed.
Definition: F1X0IntegrationAlg.h:84
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripOutputTime
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
Definition: F1X0IntegrationAlg.h:95
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_edmStripOutputBufferList
std::vector< cl::Buffer > m_edmStripOutputBufferList
Definition: F1X0IntegrationAlg.h:126
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_stripClusterOutputBufferList
std::vector< cl::Buffer > m_stripClusterOutputBufferList
Definition: F1X0IntegrationAlg.h:116
TrigRoiDescriptorCollection.h
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_pixelClusteringTime
std::atomic< cl_ulong > m_pixelClusteringTime
Time for pixel clustering.
Definition: F1X0IntegrationAlg.h:87
EFTrackingFPGAIntegration::F1X0IntegrationAlg::initialize
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
Definition: F1X0IntegrationAlg.cxx:15
EFTrackingFPGAIntegration::F1X0IntegrationAlg::m_FPGAStripRDOSize
SG::ReadHandleKey< int > m_FPGAStripRDOSize
Definition: F1X0IntegrationAlg.h:53
ServiceHandle< IChronoSvc >