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