ATLAS Offline Software
F110StreamIntegrationAlg.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_F110StreamIntegrationAlg_H
10 #define EFTRACKING_FPGA_INTEGRATION_F110StreamIntegrationAlg_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{this, "xclbin", "", "xclbin path and name"};
53 
54 
55  Gaudi::Property<std::string> m_pixelEdmKernelName{this, "PixelEDMPrepKernelName", "", "Name of the FPGA kernel"};
56 
57  Gaudi::Property<std::string> m_stripEdmKernelName{this, "StripEDMPrepKernelName", "", "Name of the FPGA kernel"};
58 
59  Gaudi::Property<std::string> m_pixelStartClusterKernelName{this, "PixelStartClusterKernelName", "", "Name of the pixel clustering start kernel"};
60  Gaudi::Property<std::string> m_pixelEndClusterKernelName{this, "PixelEndClusterKernelName", "", "Name of the pixel clustering end kernel"};
61 
62  Gaudi::Property<std::string> m_stripStartClusterKernelName{this, "StripStartClusterKernelName", "", "Name of the strip clustering start kernel"};
63  Gaudi::Property<std::string> m_stripEndClusterKernelName{this, "StripEndClusterKernelName", "", "Name of the strip clustering end kernel"};
64 
65 
66  Gaudi::Property<std::string> m_stripL2GKernelName{this, "StripL2GKernelName", "", "Name of the strip L2G kernel"};
67 
68 
69 
70  mutable std::atomic<ulonglong> m_numEvents{0};
71  mutable std::atomic<cl_ulong> m_pixelInputTime{0};
72  mutable std::atomic<cl_ulong> m_stripInputTime{0};
73  mutable std::atomic<cl_ulong> m_pixelClusteringTime{0};
74  mutable std::atomic<cl_ulong> m_stripClusteringTime{0};
75  mutable std::atomic<cl_ulong> m_stripL2GTime{0};
76  mutable std::atomic<cl_ulong> m_pixelEdmPrepTime{0};
77  mutable std::atomic<cl_ulong> m_stripEdmPrepTime{0};
78  mutable std::atomic<cl_ulong> m_pixelOutputTime{0};
79  mutable std::atomic<cl_ulong> m_stripOutputTime{0};
80  mutable std::atomic<cl_ulong> m_kernelTime{0};
81 
82  // Kernels
83  // Clustering
84  mutable std::vector<cl::Kernel> m_pixelStartClusteringKernels ATLAS_THREAD_SAFE;
85  mutable std::vector<cl::Kernel> m_pixelEndClusteringKernels ATLAS_THREAD_SAFE;
86  mutable std::vector<cl::Kernel> m_stripStartClusteringKernels ATLAS_THREAD_SAFE;
87  mutable std::vector<cl::Kernel> m_stripEndClusteringKernels ATLAS_THREAD_SAFE;
88 
89  // L2G
90  mutable std::vector<cl::Kernel> m_stripL2GKernels ATLAS_THREAD_SAFE;
91 
92  // EDM prep
93  mutable std::vector<cl::Kernel> m_pixelEdmPrepKernels ATLAS_THREAD_SAFE;
94  mutable std::vector<cl::Kernel> m_stripEdmPrepKernels ATLAS_THREAD_SAFE;
95 
96  // Buffers for input
97  std::vector<cl::Buffer> m_pixelClusterInputBufferList;
98  std::vector<cl::Buffer> m_stripClusterInputBufferList;
99  // Buffers for Clustering
100  std::vector<cl::Buffer> m_stripClusterOutputBufferList;
101  std::vector<cl::Buffer> m_pixelClusterEDMOutputBufferList;
102  std::vector<cl::Buffer> m_stripClusterEDMOutputBufferList;
103  // L2G
104  std::vector<cl::Buffer> m_stripL2GOutputBufferList;
105  std::vector<cl::Buffer> m_stripL2GEDMOutputBufferList;
106  // EDMPrep
107  std::vector<cl::Buffer> m_edmPixelOutputBufferList;
108  std::vector<cl::Buffer> m_edmStripOutputBufferList;
109 
110  // Command queue
111  std::vector<cl::CommandQueue> m_acc_queues;
112  void getListofCUs(std::vector<std::string>& cuNames);
113 
114 
115  };
116 }
117 
118 #endif // EFTRACKING_FPGA_INTEGRATION_F110StreamIntegrationAlg_H
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripClusterOutputBufferList
std::vector< cl::Buffer > m_stripClusterOutputBufferList
Definition: F110StreamIntegrationAlg.h:100
EFTrackingFPGAIntegration::F110StreamIntegrationAlg
This is the class for the benchmark algorithm specific to the FPGA integration and output conversion.
Definition: F110StreamIntegrationAlg.h:34
IRegSelTool.h
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_chronoSvc
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
Definition: F110StreamIntegrationAlg.h:42
IntegrationBase
The base class for the EFTracking FPGA integration development.
Definition: IntegrationBase.h:38
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelStartClusterKernelName
Gaudi::Property< std::string > m_pixelStartClusterKernelName
Name of the pixel clustering kernel start.
Definition: F110StreamIntegrationAlg.h:59
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::initialize
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
Definition: F110StreamIntegrationAlg.cxx:15
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_acc_queues
std::vector< cl::CommandQueue > m_acc_queues
Definition: F110StreamIntegrationAlg.h:111
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripL2GOutputBufferList
std::vector< cl::Buffer > m_stripL2GOutputBufferList
Definition: F110StreamIntegrationAlg.h:104
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_FPGAPixelRDO
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAPixelRDO
Definition: F110StreamIntegrationAlg.h:44
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_FPGAThreads
Gaudi::Property< int > m_FPGAThreads
Definition: F110StreamIntegrationAlg.h:50
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::finalize
virtual StatusCode finalize() override final
Definition: F110StreamIntegrationAlg.cxx:302
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripClusteringTime
std::atomic< cl_ulong > m_stripClusteringTime
Time for strip clustering.
Definition: F110StreamIntegrationAlg.h:74
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelClusterInputBufferList
std::vector< cl::Buffer > m_pixelClusterInputBufferList
Definition: F110StreamIntegrationAlg.h:97
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_kernelTime
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
Definition: F110StreamIntegrationAlg.h:80
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelOutputTime
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
Definition: F110StreamIntegrationAlg.h:78
IntegrationBase.h
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripL2GEDMOutputBufferList
std::vector< cl::Buffer > m_stripL2GEDMOutputBufferList
Definition: F110StreamIntegrationAlg.h:105
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripL2GKernels ATLAS_THREAD_SAFE
Definition: F110StreamIntegrationAlg.h:90
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_numEvents
std::atomic< ulonglong > m_numEvents
Number of events processed.
Definition: F110StreamIntegrationAlg.h:70
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripStartClusteringKernels ATLAS_THREAD_SAFE
Definition: F110StreamIntegrationAlg.h:86
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripClusterInputBufferList
std::vector< cl::Buffer > m_stripClusterInputBufferList
Definition: F110StreamIntegrationAlg.h:98
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_xclbin
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
Definition: F110StreamIntegrationAlg.h:52
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelClusterEDMOutputBufferList
std::vector< cl::Buffer > m_pixelClusterEDMOutputBufferList
Definition: F110StreamIntegrationAlg.h:101
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripEndClusteringKernels ATLAS_THREAD_SAFE
Definition: F110StreamIntegrationAlg.h:87
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelClusteringTime
std::atomic< cl_ulong > m_pixelClusteringTime
Time for pixel clustering.
Definition: F110StreamIntegrationAlg.h:73
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_pixelEndClusteringKernels ATLAS_THREAD_SAFE
Definition: F110StreamIntegrationAlg.h:85
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripStartClusterKernelName
Gaudi::Property< std::string > m_stripStartClusterKernelName
Name of the strip clustering kernel start.
Definition: F110StreamIntegrationAlg.h:62
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::F110StreamIntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_stripEdmPrepKernels ATLAS_THREAD_SAFE
Definition: F110StreamIntegrationAlg.h:94
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_pixelEdmPrepKernels ATLAS_THREAD_SAFE
Definition: F110StreamIntegrationAlg.h:93
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripClusterEDMOutputBufferList
std::vector< cl::Buffer > m_stripClusterEDMOutputBufferList
Definition: F110StreamIntegrationAlg.h:102
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::ATLAS_THREAD_SAFE
std::vector< cl::Kernel > m_pixelStartClusteringKernels ATLAS_THREAD_SAFE
Definition: F110StreamIntegrationAlg.h:84
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelEdmPrepTime
std::atomic< cl_ulong > m_pixelEdmPrepTime
Time for pixel EDM preparation.
Definition: F110StreamIntegrationAlg.h:76
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_FPGAPixelOutput
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGAPixelOutput
Definition: F110StreamIntegrationAlg.h:47
EFTrackingFPGAIntegration
The class for enconding RDO to FPGA format.
Definition: BenchmarkAlg.h:28
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelEndClusterKernelName
Gaudi::Property< std::string > m_pixelEndClusterKernelName
Name of the pixel clustering kernel start.
Definition: F110StreamIntegrationAlg.h:60
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_FPGAStripOutput
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGAStripOutput
Definition: F110StreamIntegrationAlg.h:48
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripInputTime
std::atomic< cl_ulong > m_stripInputTime
Time for strip input buffer write.
Definition: F110StreamIntegrationAlg.h:72
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelInputTime
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
Definition: F110StreamIntegrationAlg.h:71
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripL2GTime
std::atomic< cl_ulong > m_stripL2GTime
Time for strip L2G.
Definition: F110StreamIntegrationAlg.h:75
EFTrackingTransient.h
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_edmPixelOutputBufferList
std::vector< cl::Buffer > m_edmPixelOutputBufferList
Definition: F110StreamIntegrationAlg.h:107
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripEdmPrepTime
std::atomic< cl_ulong > m_stripEdmPrepTime
Time for strip EDM preparation.
Definition: F110StreamIntegrationAlg.h:77
PixelRDO_Container.h
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripL2GKernelName
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
Definition: F110StreamIntegrationAlg.h:66
xAODClusterMaker.h
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripEndClusterKernelName
Gaudi::Property< std::string > m_stripEndClusterKernelName
Name of the strip clustering kernel start.
Definition: F110StreamIntegrationAlg.h:63
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
Definition: F110StreamIntegrationAlg.cxx:112
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_edmStripOutputBufferList
std::vector< cl::Buffer > m_edmStripOutputBufferList
Definition: F110StreamIntegrationAlg.h:108
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_pixelEdmKernelName
Gaudi::Property< std::string > m_pixelEdmKernelName
Name of the FPGA kernel.
Definition: F110StreamIntegrationAlg.h:55
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripEdmKernelName
Gaudi::Property< std::string > m_stripEdmKernelName
Name of the FPGA kernel.
Definition: F110StreamIntegrationAlg.h:57
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_stripOutputTime
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
Definition: F110StreamIntegrationAlg.h:79
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::getListofCUs
void getListofCUs(std::vector< std::string > &cuNames)
Definition: F110StreamIntegrationAlg.cxx:324
EFTrackingFPGAIntegration::F110StreamIntegrationAlg::m_FPGAStripRDO
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAStripRDO
Definition: F110StreamIntegrationAlg.h:45
TrigRoiDescriptorCollection.h
ServiceHandle< IChronoSvc >