ATLAS Offline Software
Loading...
Searching...
No Matches
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
8
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:
44 ServiceHandle<IChronoSvc> m_chronoSvc{"ChronoStatSvc", name()};
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
Header file to be included by clients of the Monitored infrastructure.
This is the class for the benchmark algorithm specific to the FPGA integration and output conversion.
std::atomic< ulonglong > m_numEvents
Number of events processed.
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
ToolHandle< GenericMonitoringTool > m_monTool
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAPixelRDO
void getListofCUs(std::vector< std::string > &cuNames)
std::atomic< cl_ulong > m_stripL2GTime
Time for strip L2G.
Gaudi::Property< std::string > m_pixelClusterKernelName
Name of the pixel clustering kernel.
Gaudi::Property< std::string > m_pixelL2GKernelName
Name of the pixel L2G kernel.
std::atomic< cl_ulong > m_stripEdmPrepTime
Time for strip EDM preparation.
std::atomic< cl_ulong > m_stripClusteringTime
Time for strip clustering.
std::atomic< cl_ulong > m_pixelClusteringTime
Time for pixel clustering.
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAPixelOutput
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAStripRDO
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
std::atomic< cl_ulong > m_pixelEdmPrepTime
Time for pixel EDM preparation.
std::vector< cl::Buffer > m_stripClusterEDMOutputBufferList
Gaudi::Property< std::string > m_pixelEdmKernelName
Name of the FPGA kernel.
std::atomic< cl_ulong > m_pixelL2GTime
Time for pixel L2G.
Gaudi::Property< bool > m_doF110
Boolean to run F110 instead of F100.
Gaudi::Property< std::string > m_stripClusterKernelName
Name of the strip clustering kernel.
virtual StatusCode finalize() override final
std::vector< cl::Kernel > m_pixelClusteringKernels ATLAS_THREAD_SAFE
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAStripOutput
std::vector< cl::Buffer > m_pixelClusterEDMOutputBufferList
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
std::atomic< cl_ulong > m_stripInputTime
Time for strip input buffer write.
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
std::atomic< cl_ulong > m_edmPrepTime
Time for EDM preparation.
Gaudi::Property< std::string > m_stripEdmKernelName
Name of the FPGA kernel.
The base class for the EFTracking FPGA integration development.
Property holding a SG store/key/clid from which a ReadHandle is made.
Property holding a SG store/key/clid from which a WriteHandle is made.
The class for enconding RDO to FPGA format.