ATLAS Offline Software
Loading...
Searching...
No Matches
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
8
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:
42 ServiceHandle<IChronoSvc> m_chronoSvc{"ChronoStatSvc", name()};
43
44 // Input and output of the alg
45 SG::ReadHandleKey<std::vector<uint64_t>> m_FPGAPixelRDO{this, "FPGAEncodedPixelKey", "FPGAEncodedPixelRDOs", "Pixel RDO converted to FPGA format"};
46 SG::ReadHandleKey<std::vector<uint64_t>> m_FPGAStripRDO{this, "FPGAEncodedStripKey", "FPGAEncodedStripRDOs", "Strip RDO converted to FPGA format"};
47
48 SG::ReadHandleKey<int> m_FPGAPixelRDOSize{this, "FPGAEncodedPixelSizeKey", "FPGAEncodedPixelSizeRDOs", "Pixel RDO converted to FPGA format"};
49 SG::ReadHandleKey<int> m_FPGAStripRDOSize{this, "FPGAEncodedStripSizeKey", "FPGAEncodedStripSizeRDOs", "Strip RDO converted to FPGA format"};
50
51 SG::WriteHandleKey<std::vector<uint32_t>> m_FPGAPixelOutput{this, "FPGAOutputPixelKey", "FPGAPixelOutput", "Pixel output from FPGA format"};
52 SG::WriteHandleKey<std::vector<uint32_t>> m_FPGAStripOutput{this, "FPGAOutputStripKey", "FPGAStripOutput", "Strip output from FPGA format"};
53
54
55 // properties
56 Gaudi::Property<int> m_FPGAThreads{this, "FPGAThreads", 1, "number of FPGA threads to initialize"};
57
58 Gaudi::Property<std::string> m_xclbin{this, "xclbin", "", "xclbin path and name"};
59
60 Gaudi::Property<std::string> m_pixelStartClusterKernelName{this, "PixelStartClusterKernelName", "", "Name of the pixel clustering start kernel"};
61 Gaudi::Property<std::string> m_pixelEndClusterKernelName{this, "PixelEndClusterKernelName", "", "Name of the pixel clustering end kernel"};
62
63 Gaudi::Property<std::string> m_stripStartClusterKernelName{this, "StripStartClusterKernelName", "", "Name of the strip clustering start kernel"};
64 Gaudi::Property<std::string> m_stripEndClusterKernelName{this, "StripEndClusterKernelName", "", "Name of the strip clustering end kernel"};
65
66 Gaudi::Property<std::string> m_pixelLUTKernelName{this, "PixelLUTKernelName", "", "Name of the pixel LUT loading kernel"};
67 Gaudi::Property<std::string> m_stripLUTKernelName{this, "StripLUTKernelName", "", "Name of the strip LUT loading kernel"};
68
69 Gaudi::Property<std::string> m_pixelLUTFilePath{this, "PixelLUTFilePath", "", "Path to the pixel LUT"};
70 Gaudi::Property<std::string> m_stripLUTFilePath{this, "StripLUTFilePath", "", "Path to the strip LUT"};
71
72 // to save information
73 mutable std::atomic<ulonglong> m_numEvents{0};
74 mutable std::atomic<cl_ulong> m_pixelInputTime{0};
75 mutable std::atomic<cl_ulong> m_stripInputTime{0};
76
77 mutable std::atomic<cl_ulong> m_pixelPipelineTime{0};
78 mutable std::atomic<cl_ulong> m_stripPipelineTime{0};
79 mutable std::atomic<cl_ulong> m_pixelOutputTime{0};
80 mutable std::atomic<cl_ulong> m_stripOutputTime{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 mutable std::vector<cl::Kernel> m_pixelLUTKernels ATLAS_THREAD_SAFE;
89 mutable std::vector<cl::Kernel> m_stripLUTKernels ATLAS_THREAD_SAFE;
90
91 // Buffers for input
92 std::vector<cl::Buffer> m_pixelClusterInputBufferList;
93 std::vector<cl::Buffer> m_stripClusterInputBufferList;
94
95 // EDMPrep
96 std::vector<cl::Buffer> m_edmPixelOutputBufferList;
97 std::vector<cl::Buffer> m_edmStripOutputBufferList;
98
99 // Command queue
100 std::vector<cl::CommandQueue> m_acc_queues;
101 void getListofCUs(std::vector<std::string>& cuNames);
102 StatusCode readCalibfile(std::string inputFileName, std::vector<uint64_t>& data);
103
104
105 };
106}
107
108#endif // EFTRACKING_FPGA_INTEGRATION_F110StreamIntegrationAlg_H
char data[hepevt_bytes_allocation_ATLAS]
Definition HepEvt.cxx:11
This is the class for the benchmark algorithm specific to the FPGA integration and output conversion.
std::atomic< cl_ulong > m_stripPipelineTime
Time for strip pipeline.
Gaudi::Property< std::string > m_stripStartClusterKernelName
Name of the strip clustering kernel start.
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAPixelOutput
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
Gaudi::Property< std::string > m_pixelStartClusterKernelName
Name of the pixel clustering kernel start.
Gaudi::Property< std::string > m_stripLUTKernelName
Name of the pixel lut loading kernel.
SG::WriteHandleKey< std::vector< uint32_t > > m_FPGAStripOutput
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
Gaudi::Property< std::string > m_stripEndClusterKernelName
Name of the strip clustering kernel start.
void getListofCUs(std::vector< std::string > &cuNames)
std::vector< cl::Kernel > m_pixelStartClusteringKernels ATLAS_THREAD_SAFE
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
Gaudi::Property< std::string > m_pixelLUTKernelName
Name of the pixel lut loading kernel.
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAStripRDO
StatusCode readCalibfile(std::string inputFileName, std::vector< uint64_t > &data)
std::atomic< cl_ulong > m_stripInputTime
Time for strip input buffer write.
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
std::atomic< cl_ulong > m_pixelPipelineTime
Time for pixel pipeline.
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAPixelRDO
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
std::atomic< ulonglong > m_numEvents
Number of events processed.
Gaudi::Property< std::string > m_pixelEndClusterKernelName
Name of the pixel clustering kernel start.
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
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.