ATLAS Offline Software
Loading...
Searching...
No Matches
F150IntegrationAlg.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_F150IntegrationAlg_H
10#define EFTRACKING_FPGA_INTEGRATION_F150IntegrationAlg_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 SG::WriteHandleKey<std::vector<uint64_t>> m_FPGATrackOutput{this, "FPGAOutputTrackKey", "FPGATrackOutput", "Track output from FPGA format"};
52
53 Gaudi::Property<int> m_FPGAThreads{this, "FPGAThreads", 1, "number of FPGA threads to initialize"};
54 Gaudi::Property<bool> m_outputTextFile{this, "outputTextFile", "", "Whether to output text file"};
55
56 Gaudi::Property<std::string> m_xclbin{this, "xclbin", "", "xclbin path and name"};
57
58 Gaudi::Property<std::string> m_pixelEdmKernelName{this, "PixelEDMPrepKernelName", "", "Name of the FPGA kernel"};
59 Gaudi::Property<std::string> m_stripEdmKernelName{this, "StripEDMPrepKernelName", "", "Name of the FPGA kernel"};
60 Gaudi::Property<std::string> m_pixelClusterKernelName{this, "PixelClusterKernelName", "", "Name of the pixel clustering kernel"};
61 Gaudi::Property<std::string> m_stripClusterKernelName{this, "StripClusterKernelName", "", "Name of the strip clustering kernel"};
62 Gaudi::Property<std::string> m_stripL2GKernelName{this, "StripL2GKernelName", "", "Name of the strip L2G kernel"};
63 Gaudi::Property<std::string> m_slicingEngineInputName{this, "SlicingEngineInputName", "", "Name of the slicing engine input kernel"};
64 Gaudi::Property<std::string> m_slicingEngineOutputName{this, "SlicingEngineOutputName", "", "Name of the slicing engine output kernel"};
65 Gaudi::Property<std::string> m_insideOutInputName{this, "InsideOutInputName", "", "Name of the inside out input kernel"};
66 Gaudi::Property<std::string> m_insideOutOutputName{this, "InsideOutOutputName", "", "Name of the inside out output kernel"};
67
68 ToolHandle< GenericMonitoringTool > m_monTool { this, "MonTool", "", "Monitoring tool" };
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_pixelClusteringKernels ATLAS_THREAD_SAFE;
85 mutable std::vector<cl::Kernel> m_stripClusteringKernels ATLAS_THREAD_SAFE;
86
87 // L2G
88 mutable std::vector<cl::Kernel> m_stripL2GKernels ATLAS_THREAD_SAFE;
89
90 // EDM prep
91 mutable std::vector<cl::Kernel> m_pixelEdmPrepKernels ATLAS_THREAD_SAFE;
92 mutable std::vector<cl::Kernel> m_stripEdmPrepKernels ATLAS_THREAD_SAFE;
93
94 mutable std::vector<cl::Kernel> m_slicingEngineInputKernels ATLAS_THREAD_SAFE;
95 mutable std::vector<cl::Kernel> m_slicingEngineOutputKernels ATLAS_THREAD_SAFE;
96 mutable std::vector<cl::Kernel> m_insideOutInputKernels ATLAS_THREAD_SAFE;
97 mutable std::vector<cl::Kernel> m_insideOutOutputKernels ATLAS_THREAD_SAFE;
98
99 // Buffers for input
100 std::vector<cl::Buffer> m_pixelClusterInputBufferList;
101 std::vector<cl::Buffer> m_stripClusterInputBufferList;
102 // Buffers for Clustering
103 std::vector<cl::Buffer> m_pixelClusterOutputBufferList;
104 std::vector<cl::Buffer> m_stripClusterOutputBufferList;
105 std::vector<cl::Buffer> m_pixelClusterEDMOutputBufferList;
106 std::vector<cl::Buffer> m_stripClusterEDMOutputBufferList;
107 // L2G
108 std::vector<cl::Buffer> m_stripL2GInputBufferList;
109 std::vector<cl::Buffer> m_stripL2GEDMInputBufferList;
110 std::vector<cl::Buffer> m_stripL2GOutputBufferList;
111 std::vector<cl::Buffer> m_stripL2GEDMOutputBufferList;
112
113 // EDM prep
114 std::vector<cl::Buffer> m_edmPixelInputBufferList;
115 std::vector<cl::Buffer> m_edmStripInputBufferList;
116 std::vector<cl::Buffer> m_edmPixelOutputBufferList;
117 std::vector<cl::Buffer> m_edmStripOutputBufferList;
118
119 // Slicing
120 std::vector<cl::Buffer> m_slicingEngineInputBufferList;
121 std::vector<cl::Buffer> m_slicingEngineOutputBufferList;
122
123 // insideout
124 std::vector<cl::Buffer> m_insideOutInputBufferList;
125 std::vector<cl::Buffer> m_insideOutOutputBufferList;
126
127 // Command queue
128 std::vector<cl::CommandQueue> m_acc_queues;
129 void getListofCUs(std::vector<std::string>& cuNames);
130
131 void dumpHexData(std::span<const uint64_t> data, const std::string& dataDescriptor, const EventContext &ctx) const;
132
133
134 };
135}
136
137#endif // EFTRACKING_FPGA_INTEGRATION_F150IntegrationAlg_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
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.
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAPixelRDO
ToolHandle< GenericMonitoringTool > m_monTool
Gaudi::Property< std::string > m_slicingEngineInputName
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
Gaudi::Property< std::string > m_insideOutInputName
std::vector< cl::Buffer > m_slicingEngineOutputBufferList
void getListofCUs(std::vector< std::string > &cuNames)
std::atomic< ulonglong > m_numEvents
Number of events processed.
Gaudi::Property< std::string > m_pixelClusterKernelName
Name of the pixel clustering kernel.
std::atomic< cl_ulong > m_pixelClusteringTime
Time for pixel clustering.
Gaudi::Property< std::string > m_stripEdmKernelName
Name of the FPGA kernel.
std::vector< cl::Buffer > m_stripClusterEDMOutputBufferList
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
std::atomic< cl_ulong > m_stripL2GTime
Time for strip L2G.
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
virtual StatusCode finalize() override final
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
std::vector< cl::Kernel > m_pixelClusteringKernels ATLAS_THREAD_SAFE
std::atomic< cl_ulong > m_stripInputTime
Time for strip input buffer write.
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAStripOutput
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
void dumpHexData(std::span< const uint64_t > data, const std::string &dataDescriptor, const EventContext &ctx) const
Gaudi::Property< std::string > m_slicingEngineOutputName
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAPixelOutput
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
Gaudi::Property< bool > m_outputTextFile
Whether to run SE or not.
std::vector< cl::Buffer > m_pixelClusterEDMOutputBufferList
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGATrackOutput
std::atomic< cl_ulong > m_stripClusteringTime
Time for strip clustering.
std::atomic< cl_ulong > m_stripEdmPrepTime
Time for strip EDM preparation.
Gaudi::Property< std::string > m_pixelEdmKernelName
Name of the FPGA kernel.
Gaudi::Property< std::string > m_insideOutOutputName
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAStripRDO
std::atomic< cl_ulong > m_pixelEdmPrepTime
Time for pixel EDM preparation.
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
Gaudi::Property< std::string > m_stripClusterKernelName
Name of the strip clustering kerne.
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.