ATLAS Offline Software
BenchmarkAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
13 #include "AthenaKernel/Chrono.h"
14 
16 {
18  {
19  ATH_MSG_INFO("Running on the FPGA accelerator");
20 
22 
23  ATH_CHECK(m_chronoSvc.retrieve());
24 
25  {
26  Athena::Chrono chrono("Platform and device initlize", m_chronoSvc.get());
28  }
29 
30  {
31  Athena::Chrono chrono("CL::loadProgram", m_chronoSvc.get());
33  }
34  ATH_MSG_INFO("loading "<<m_xclbin);
39 
40  ATH_CHECK(m_xaodClusterMaker.retrieve());
41  ATH_CHECK(m_testVectorTool.retrieve());
42  ATH_CHECK(m_FPGADataFormatTool.retrieve());
43  return StatusCode::SUCCESS;
44  }
45 
46  StatusCode BenchmarkAlg::execute(const EventContext &ctx) const
47  {
48  ATH_MSG_DEBUG("Executing BenchmarkAlg");
49  m_numEvents++;
50 
51  // Create host side output vectors
52  std::vector<uint64_t> pixelOutput(EFTrackingTransient::PIXEL_CONTAINER_BUF_SIZE, 0);
53  std::vector<uint64_t> stripOutput(EFTrackingTransient::STRIP_CONTAINER_BUF_SIZE, 0);
54 
55  if (m_runPassThrough)
56  {
57  ATH_CHECK(runPassThrough(pixelOutput, stripOutput, ctx));
58  }
59  else // using the actual FPGA kernel chain
60  {
61  ATH_CHECK(runDataPrep(pixelOutput, stripOutput, ctx));
62  }
63 
64  // use 64-bit pointer to access output
65  uint64_t *stripClusters = stripOutput.data();
66  uint64_t *pixelClusters = pixelOutput.data();
67 
68  unsigned int numStripClusters = stripClusters[0];
69  ATH_MSG_DEBUG("numStripClusters: " << numStripClusters);
70 
71  unsigned int numPixelClusters = pixelClusters[0];
72  ATH_MSG_DEBUG("numPixelClusters: " << numPixelClusters);
73 
74  std::unique_ptr<EFTrackingTransient::Metadata> metadata =
75  std::make_unique<EFTrackingTransient::Metadata>();
76 
77  metadata->numOfStripClusters = numStripClusters;
78  metadata->scRdoIndexSize = numStripClusters;
79  metadata->numOfPixelClusters = numPixelClusters;
80  metadata->pcRdoIndexSize = numPixelClusters;
81 
82  // make strip cluster
83  ATH_CHECK(m_xaodClusterMaker->makeStripClusterContainer(stripClusters, metadata.get(), ctx));
84 
85  // Make pixel cluster
86  ATH_CHECK(m_xaodClusterMaker->makePixelClusterContainer(pixelClusters, metadata.get(), ctx));
87 
88  return StatusCode::SUCCESS;
89  }
90 
91  StatusCode BenchmarkAlg::runPassThrough(std::vector<uint64_t> &pixelChainOutput, std::vector<uint64_t> &stripChainOutput, const EventContext &ctx) const
92  {
93  cl_int err = 0;
94 
95  // Load the ITk clusters from SG
97  if (!scContainerHandle.isValid())
98  {
99  ATH_MSG_ERROR("Failed to retrieve: " << m_inputStripClusterKey);
100  return StatusCode::FAILURE;
101  }
102 
104  if (!pcContainerHandle.isValid())
105  {
106  ATH_MSG_ERROR("Failed to retrieve: " << m_inputPixelClusterKey);
107  return StatusCode::FAILURE;
108  }
109 
110  // Encode ITK clusters into byte stream
111  std::vector<uint64_t> encodedStripClusters;
112  std::vector<uint64_t> encodedPixelClusters;
113  ATH_CHECK(m_testVectorTool->encodeStripL2G(scContainerHandle.get(), encodedStripClusters));
114  ATH_CHECK(m_testVectorTool->encodePixelL2G(pcContainerHandle.get(), encodedPixelClusters));
115 
116  // Create local CL buffers and kernel object for pixel and strip
117  cl::Buffer inputPixelBuffer(m_context, CL_MEM_READ_ONLY, EFTrackingTransient::PIXEL_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err);
118  cl::Buffer inputStripBuffer(m_context, CL_MEM_READ_ONLY, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err);
119  cl::Buffer outputPixelBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::PIXEL_CONTAINER_BUF_SIZE * sizeof(uint64_t), NULL, &err);
120  cl::Buffer outputStripBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_CONTAINER_BUF_SIZE * sizeof(uint64_t), NULL, &err);
121 
122  cl::Kernel kernel(m_program, m_edmKernelName.value().data());
123  kernel.setArg<cl::Buffer>(0, inputPixelBuffer);
124  kernel.setArg<cl::Buffer>(1, inputStripBuffer);
125  kernel.setArg<cl::Buffer>(2, outputPixelBuffer);
126  kernel.setArg<cl::Buffer>(3, outputStripBuffer);
127 
128  // Migrate the input test vectors to the accelerator
129  cl::CommandQueue acc_queue(m_context, m_accelerator);
130  acc_queue.enqueueWriteBuffer(inputPixelBuffer, CL_FALSE, 0, sizeof(uint64_t) * encodedPixelClusters.size(), encodedPixelClusters.data(), NULL, NULL);
131  acc_queue.enqueueWriteBuffer(inputStripBuffer, CL_FALSE, 0, sizeof(uint64_t) * encodedStripClusters.size(), encodedStripClusters.data(), NULL, NULL);
132  acc_queue.finish();
133 
134  // enqueue the kernel
135  {
136  Athena::Chrono chrono("EDMPrep kernel execution", m_chronoSvc.get());
137  acc_queue.enqueueTask(kernel);
138  acc_queue.finish();
139  }
140 
141  // Read back the results
142  {
143  Athena::Chrono chrono("Read buffers", m_chronoSvc.get());
144  acc_queue.enqueueReadBuffer(outputPixelBuffer, CL_FALSE, 0, sizeof(uint64_t) * pixelChainOutput.size(), pixelChainOutput.data(), NULL, NULL);
145  acc_queue.enqueueReadBuffer(outputStripBuffer, CL_FALSE, 0, sizeof(uint64_t) * stripChainOutput.size(), stripChainOutput.data(), NULL, NULL);
146  acc_queue.finish();
147  }
148 
149  return StatusCode::SUCCESS;
150  }
151 
152  StatusCode BenchmarkAlg::runDataPrep(std::vector<uint64_t> &pixelChainOutput, std::vector<uint64_t> &stripChainOutput, const EventContext &ctx) const
153  {
154  ATH_MSG_DEBUG("Running DataPrep on FPGA");
155  cl_int err = 0;
156 
157  // Get the RDOs from the SG
158  auto pixelRDOHandle = SG::makeHandle(m_pixelRDOKey, ctx);
159  auto stripRDOHandle = SG::makeHandle(m_stripRDOKey, ctx);
160 
161  // Encode RDO into byte stream
162  std::vector<uint64_t> encodedPixelRDO;
163  std::vector<uint64_t> encodedStripRDO;
164 
165  std::vector<IdentifierHash> listOfPixelIds;
166  std::vector<IdentifierHash> listOfStripIds;
167 
168  // Encode RDOs into byte stream
169  ATH_CHECK(m_FPGADataFormatTool->convertPixelHitsToFPGADataFormat(*pixelRDOHandle, encodedPixelRDO, listOfPixelIds, ctx));
170  ATH_CHECK(m_FPGADataFormatTool->convertStripHitsToFPGADataFormat(*stripRDOHandle, encodedStripRDO, listOfStripIds, ctx));
171 
172  for (unsigned int i = 0; i < encodedPixelRDO.size(); i++)
173  {
174  ATH_MSG_DEBUG("Pixel RDO[" << i << "]: " << std::hex << encodedPixelRDO[i] << std::dec);
175  }
176  for (unsigned int i = 0; i < encodedStripRDO.size(); i++)
177  {
178  ATH_MSG_DEBUG("Strip RDO[" << i << "]: " << std::hex << encodedStripRDO[i] << std::dec);
179  }
180 
181  // Create local CL buffers
182  // Clustering
183  cl::Buffer pixelClusterInputBuffer(m_context, CL_MEM_READ_ONLY, sizeof(uint64_t) * encodedPixelRDO.size(), NULL, &err);
184  cl::Buffer stripClusterInputBuffer(m_context, CL_MEM_READ_ONLY, sizeof(uint64_t) * encodedStripRDO.size(), NULL, &err);
185  cl::Buffer pixelClusterOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::PIXEL_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err); // Don't care in DataPrep
186  cl::Buffer stripClusterOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err); // Don't care in DataPrep
187  cl::Buffer pixelClusterEDMOutputBuffer(m_context, CL_MEM_READ_WRITE,EFTrackingTransient::PIXEL_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err);
188  cl::Buffer stripClusterEDMOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err);
189  // L2G
190  cl::Buffer pixelL2GOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::PIXEL_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err); // Don't care in DataPrep
191  cl::Buffer stripL2GOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err); // Don't care in DataPrep
192  cl::Buffer pixelL2GEDMOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::PIXEL_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err);
193  cl::Buffer stripL2GEDMOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err);
194  // EDMPrep
195  cl::Buffer edmPixelOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::PIXEL_CONTAINER_BUF_SIZE * sizeof(uint64_t), NULL, &err);
196  cl::Buffer edmStripOutputBuffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_CONTAINER_BUF_SIZE * sizeof(uint64_t), NULL, &err);
197 
198  // Create local CL kernel objects
199  // Clustering
200  // Kernel names are hard-coded for the current development
201  cl::Kernel pixelClusteringKernel(m_program, m_pixelClusterKernelName.value().data());
202  pixelClusteringKernel.setArg<cl::Buffer>(0, pixelClusterInputBuffer);
203  pixelClusteringKernel.setArg<cl::Buffer>(1, pixelClusterOutputBuffer);
204  pixelClusteringKernel.setArg<cl::Buffer>(2, pixelClusterEDMOutputBuffer);
205 
206  cl::Kernel stripClusteringKernel(m_program, m_stripClusterKernelName.value().data());
207  stripClusteringKernel.setArg<cl::Buffer>(0, stripClusterInputBuffer);
208  stripClusteringKernel.setArg<cl::Buffer>(1, stripClusterOutputBuffer);
209  stripClusteringKernel.setArg<cl::Buffer>(2, stripClusterEDMOutputBuffer);
210  stripClusteringKernel.setArg<unsigned int>(3, encodedStripRDO.size());
211 
212  // L2G
213  cl::Kernel pixelL2GKernel(m_program, m_pixelL2GKernelName.value().data());
214  pixelL2GKernel.setArg<cl::Buffer>(0, pixelClusterOutputBuffer);
215  pixelL2GKernel.setArg<cl::Buffer>(1, pixelClusterEDMOutputBuffer);
216  pixelL2GKernel.setArg<cl::Buffer>(2, pixelL2GOutputBuffer);
217  pixelL2GKernel.setArg<cl::Buffer>(3, pixelL2GEDMOutputBuffer);
218 
219  cl::Kernel stripL2GKernel(m_program, m_stripL2GKernelName.value().data());
220  stripL2GKernel.setArg<cl::Buffer>(0, stripClusterOutputBuffer);
221  stripL2GKernel.setArg<cl::Buffer>(1, stripClusterEDMOutputBuffer);
222  stripL2GKernel.setArg<cl::Buffer>(2, stripL2GOutputBuffer);
223  stripL2GKernel.setArg<cl::Buffer>(3, stripL2GEDMOutputBuffer);
224 
225  // Create EDMPrep kernel object and connect to buffers
226  cl::Kernel edmPrepKernel(m_program, m_edmKernelName.value().data());
227  edmPrepKernel.setArg<cl::Buffer>(0, pixelL2GEDMOutputBuffer);
228  edmPrepKernel.setArg<cl::Buffer>(1, stripL2GEDMOutputBuffer);
229  edmPrepKernel.setArg<cl::Buffer>(2, edmPixelOutputBuffer);
230  edmPrepKernel.setArg<cl::Buffer>(3, edmStripOutputBuffer);
231 
232  cl::CommandQueue acc_queue(m_context, m_accelerator, CL_QUEUE_PROFILING_ENABLE, &err);
233 
234  cl::Event cl_evt_write_pixel_input;
235  cl::Event cl_evt_write_strip_input;
236  acc_queue.enqueueWriteBuffer(pixelClusterInputBuffer, CL_FALSE, 0, sizeof(uint64_t) * encodedPixelRDO.size(), encodedPixelRDO.data(), NULL, &cl_evt_write_pixel_input);
237  acc_queue.enqueueWriteBuffer(stripClusterInputBuffer, CL_FALSE, 0, sizeof(uint64_t) * encodedStripRDO.size(), encodedStripRDO.data(), NULL, &cl_evt_write_strip_input);
238  std::vector<cl::Event> cl_evt_vec_pixel_input{cl_evt_write_pixel_input};
239  std::vector<cl::Event> cl_evt_vec_strip_input{cl_evt_write_strip_input};
240  // Ideally, `finish` shouldn't be here because the kernels are invoked by event dependencies,
241  // but we use this to temporarily enable kernel profiling.
242  acc_queue.finish();
243 
244  cl::Event cl_evt_pixel_clustering;
245  cl::Event cl_evt_strip_clustering;
246  cl::Event cl_evt_pixel_l2g;
247  cl::Event cl_evt_strip_l2g;
248  cl::Event cl_evt_edm_prep;
249  {
250  Athena::Chrono chrono("Kernel execution", m_chronoSvc.get());
251  acc_queue.enqueueTask(pixelClusteringKernel, &cl_evt_vec_pixel_input, &cl_evt_pixel_clustering);
252  acc_queue.enqueueTask(stripClusteringKernel, &cl_evt_vec_strip_input, &cl_evt_strip_clustering);
253 
254  std::vector<cl::Event> cl_evt_vec_pixel_clustering{cl_evt_pixel_clustering};
255  std::vector<cl::Event> cl_evt_vec_strip_clustering{cl_evt_strip_clustering};
256  acc_queue.enqueueTask(pixelL2GKernel, &cl_evt_vec_pixel_clustering, &cl_evt_pixel_l2g);
257  acc_queue.enqueueTask(stripL2GKernel, &cl_evt_vec_strip_clustering, &cl_evt_strip_l2g);
258  std::vector<cl::Event> cl_evt_vec_l2g{cl_evt_pixel_l2g, cl_evt_strip_l2g};
259 
260  acc_queue.enqueueTask(edmPrepKernel, &cl_evt_vec_l2g, &cl_evt_edm_prep);
261  // Ideally, `finish` shouldn't be here because the kernels are invoked by event dependencies,
262  // but we use this to temporarily enable kernel profiling. CPU wall time
263  acc_queue.finish();
264  }
265 
266  cl::Event cl_evt_pixel_cluster_output;
267  cl::Event cl_evt_strip_cluster_output;
268  acc_queue.enqueueReadBuffer(edmPixelOutputBuffer, CL_FALSE, 0, sizeof(uint64_t) * pixelChainOutput.size(), pixelChainOutput.data(), NULL, &cl_evt_pixel_cluster_output);
269  acc_queue.enqueueReadBuffer(edmStripOutputBuffer, CL_FALSE, 0, sizeof(uint64_t) * stripChainOutput.size(), stripChainOutput.data(), NULL, &cl_evt_strip_cluster_output);
270  acc_queue.finish();
271 
272  // calculate the time for the kernel execution
273  // get the time of writing pixel input buffer
274  cl_ulong pixel_input_start = cl_evt_write_pixel_input.getProfilingInfo<CL_PROFILING_COMMAND_START>();
275  cl_ulong pixel_input_end = cl_evt_write_pixel_input.getProfilingInfo<CL_PROFILING_COMMAND_END>();
276  cl_ulong pixel_input_time = pixel_input_end - pixel_input_start;
277  m_pixelInputTime += pixel_input_time;
278  ATH_MSG_DEBUG("Pixel input buffer write time: " << pixel_input_time / 1e6 << " ms");
279 
280  // get the time of writing strip input buffer
281  cl_ulong strip_input_start = cl_evt_write_strip_input.getProfilingInfo<CL_PROFILING_COMMAND_START>();
282  cl_ulong strip_input_end = cl_evt_write_strip_input.getProfilingInfo<CL_PROFILING_COMMAND_END>();
283  cl_ulong strip_input_time = strip_input_end - strip_input_start;
284  m_stripInputTime += strip_input_time;
285  ATH_MSG_DEBUG("Strip input buffer write time: " << strip_input_time / 1e6 << " ms");
286 
287  // get the time of pixel clustering
288  cl_ulong pixel_clustering_start = cl_evt_pixel_clustering.getProfilingInfo<CL_PROFILING_COMMAND_START>();
289  cl_ulong pixel_clustering_end = cl_evt_pixel_clustering.getProfilingInfo<CL_PROFILING_COMMAND_END>();
290  cl_ulong pixel_clustering_time = pixel_clustering_end - pixel_clustering_start;
291  m_pixelClusteringTime += pixel_clustering_time;
292  ATH_MSG_DEBUG("Pixel clustering time: " << pixel_clustering_time / 1e6 << " ms");
293 
294  // get the time of strip clustering
295  cl_ulong strip_clustering_start = cl_evt_strip_clustering.getProfilingInfo<CL_PROFILING_COMMAND_START>();
296  cl_ulong strip_clustering_end = cl_evt_strip_clustering.getProfilingInfo<CL_PROFILING_COMMAND_END>();
297  cl_ulong strip_clustering_time = strip_clustering_end - strip_clustering_start;
298  m_stripClusteringTime += strip_clustering_time;
299  ATH_MSG_DEBUG("Strip clustering time: " << strip_clustering_time / 1e6 << " ms");
300 
301  // get the time of pixel L2G
302  cl_ulong pixel_l2g_start = cl_evt_pixel_l2g.getProfilingInfo<CL_PROFILING_COMMAND_START>();
303  cl_ulong pixel_l2g_end = cl_evt_pixel_l2g.getProfilingInfo<CL_PROFILING_COMMAND_END>();
304  cl_ulong pixel_l2g_time = pixel_l2g_end - pixel_l2g_start;
305  m_pixelL2GTime += pixel_l2g_time;
306  ATH_MSG_DEBUG("Pixel L2G time: " << pixel_l2g_time / 1e6 << " ms");
307 
308  // get the time of strip L2G
309  cl_ulong strip_l2g_start = cl_evt_strip_l2g.getProfilingInfo<CL_PROFILING_COMMAND_START>();
310  cl_ulong strip_l2g_end = cl_evt_strip_l2g.getProfilingInfo<CL_PROFILING_COMMAND_END>();
311  cl_ulong strip_l2g_time = strip_l2g_end - strip_l2g_start;
312  m_stripL2GTime += strip_l2g_time;
313  ATH_MSG_DEBUG("Strip L2G time: " << strip_l2g_time / 1e6 << " ms");
314 
315  // get the time of EDMPrep
316  cl_ulong edm_prep_start = cl_evt_edm_prep.getProfilingInfo<CL_PROFILING_COMMAND_START>();
317  cl_ulong edm_prep_end = cl_evt_edm_prep.getProfilingInfo<CL_PROFILING_COMMAND_END>();
318  cl_ulong edm_prep_time = edm_prep_end - edm_prep_start;
319  m_edmPrepTime += edm_prep_time;
320  ATH_MSG_DEBUG("EDMPrep time: " << edm_prep_time / 1e6 << " ms");
321 
322  // get the time of the whole kernel execution
323  cl_ulong kernel_start = cl_evt_pixel_clustering.getProfilingInfo<CL_PROFILING_COMMAND_QUEUED>();
324  cl_ulong kernel_end = cl_evt_edm_prep.getProfilingInfo<CL_PROFILING_COMMAND_END>();
325  cl_ulong kernel_time = kernel_end - kernel_start;
326  m_kernelTime += kernel_time;
327  ATH_MSG_DEBUG("Kernel execution time: " << kernel_time / 1e6 << " ms");
328 
329  // get the time of reading pixel output buffer
330  cl_ulong pixel_output_start = cl_evt_pixel_cluster_output.getProfilingInfo<CL_PROFILING_COMMAND_START>();
331  cl_ulong pixel_output_end = cl_evt_pixel_cluster_output.getProfilingInfo<CL_PROFILING_COMMAND_END>();
332  cl_ulong pixel_output_time = pixel_output_end - pixel_output_start;
333  m_pixelOutputTime += pixel_output_time;
334  ATH_MSG_DEBUG("Pixel output buffer read time: " << pixel_output_time / 1e6 << " ms");
335 
336  // get the time of reading strip output buffer
337  cl_ulong strip_output_start = cl_evt_strip_cluster_output.getProfilingInfo<CL_PROFILING_COMMAND_START>();
338  cl_ulong strip_output_end = cl_evt_strip_cluster_output.getProfilingInfo<CL_PROFILING_COMMAND_END>();
339  cl_ulong strip_output_time = strip_output_end - strip_output_start;
340  m_stripOutputTime += strip_output_time;
341  ATH_MSG_DEBUG("Strip output buffer read time: " << strip_output_time / 1e6 << " ms");
342 
343  return StatusCode::SUCCESS;
344  }
345 
347  {
348  if (!m_runPassThrough)
349  {
350  ATH_MSG_INFO("Finalizing BenchmarkAlg");
351  ATH_MSG_INFO("Number of events: " << m_numEvents);
352  ATH_MSG_INFO("Pixel input time: " << m_pixelInputTime / m_numEvents / 1e6 << " ms");
353  ATH_MSG_INFO("Strip input time: " << m_stripInputTime / m_numEvents / 1e6 << " ms");
354  ATH_MSG_INFO("Pixel clustering time: " << m_pixelClusteringTime / m_numEvents / 1e6 << " ms");
355  ATH_MSG_INFO("Strip clustering time: " << m_stripClusteringTime / m_numEvents / 1e6 << " ms");
356  ATH_MSG_INFO("Pixel L2G time: " << m_pixelL2GTime / m_numEvents / 1e6 << " ms");
357  ATH_MSG_INFO("Strip L2G time: " << m_stripL2GTime / m_numEvents / 1e6 << " ms");
358  ATH_MSG_INFO("EDMPrep time: " << m_edmPrepTime / m_numEvents / 1e6 << " ms");
359  ATH_MSG_INFO("Kernel execution time: " << m_kernelTime / m_numEvents / 1e6 << " ms");
360  ATH_MSG_INFO("Pixel output time: " << m_pixelOutputTime / m_numEvents / 1e6 << " ms");
361  ATH_MSG_INFO("Strip output time: " << m_stripOutputTime / m_numEvents / 1e6 << " ms");
362  }
363 
364  return StatusCode::SUCCESS;
365  }
366 } // namespace EFTrackingFPGAIntegration
EFTrackingFPGAIntegration::BenchmarkAlg::m_edmKernelName
Gaudi::Property< std::string > m_edmKernelName
Name of the FPGA kernel.
Definition: BenchmarkAlg.h:74
IntegrationBase::m_accelerator
cl::Device m_accelerator
Device object for the accelerator card.
Definition: IntegrationBase.h:66
IntegrationBase::initialize
virtual StatusCode initialize() override
Detect the OpenCL devices and prepare OpenCL context.
Definition: IntegrationBase.cxx:16
EFTrackingFPGAIntegration::BenchmarkAlg::m_stripClusteringTime
std::atomic< cl_ulong > m_stripClusteringTime
Time for strip clustering.
Definition: BenchmarkAlg.h:96
EFTrackingFPGAIntegration::BenchmarkAlg::m_chronoSvc
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
Definition: BenchmarkAlg.h:46
EFTrackingTransient::PIXEL_CONTAINER_BUF_SIZE
constexpr unsigned long PIXEL_CONTAINER_BUF_SIZE
Definition: EFTrackingTransient.h:36
EFTrackingFPGAIntegration::BenchmarkAlg::m_pixelL2GKernelName
Gaudi::Property< std::string > m_pixelL2GKernelName
Name of the pixel L2G kernel.
Definition: BenchmarkAlg.h:83
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:67
BenchmarkAlg.h
JiveXML::Event
struct Event_t Event
Definition: ONCRPCServer.h:65
IntegrationBase::m_context
cl::Context m_context
Context object for the application.
Definition: IntegrationBase.h:67
EFTrackingFPGAIntegration::BenchmarkAlg::m_pixelL2GTime
std::atomic< cl_ulong > m_pixelL2GTime
Time for pixel L2G.
Definition: BenchmarkAlg.h:97
EFTrackingFPGAIntegration::BenchmarkAlg::initialize
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
Definition: BenchmarkAlg.cxx:17
EFTrackingFPGAIntegration::BenchmarkAlg::m_inputPixelClusterKey
SG::ReadHandleKey< xAOD::PixelClusterContainer > m_inputPixelClusterKey
Key to access input pixel clusters.
Definition: BenchmarkAlg.h:61
Chrono.h
Exception-safe IChronoSvc caller.
EFTrackingFPGAIntegration::BenchmarkAlg::finalize
virtual StatusCode finalize() override final
Definition: BenchmarkAlg.cxx:346
EFTrackingFPGAIntegration::BenchmarkAlg::m_pixelRDOKey
SG::ReadHandleKey< PixelRDO_Container > m_pixelRDOKey
Definition: BenchmarkAlg.h:67
EFTrackingFPGAIntegration::BenchmarkAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
Definition: BenchmarkAlg.cxx:46
EFTrackingFPGAIntegration::BenchmarkAlg::m_stripOutputTime
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
Definition: BenchmarkAlg.h:101
python.checkMetadata.metadata
metadata
Definition: checkMetadata.py:175
SG::makeHandle
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Definition: ReadCondHandle.h:274
EFTrackingFPGAIntegration::BenchmarkAlg::m_stripRDOKey
SG::ReadHandleKey< SCT_RDO_Container > m_stripRDOKey
Definition: BenchmarkAlg.h:69
EFTrackingTransient::PIXEL_BLOCK_BUF_SIZE
constexpr unsigned long PIXEL_BLOCK_BUF_SIZE
Definition: EFTrackingTransient.h:34
EFTrackingTransient::STRIP_CONTAINER_BUF_SIZE
constexpr unsigned long STRIP_CONTAINER_BUF_SIZE
Definition: EFTrackingTransient.h:37
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
Athena::Chrono
Exception-safe IChronoSvc caller.
Definition: Chrono.h:50
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:183
lumiFormat.i
int i
Definition: lumiFormat.py:85
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
SG::ReadHandle::get
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
EFTrackingFPGAIntegration::BenchmarkAlg::m_pixelInputTime
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
Definition: BenchmarkAlg.h:93
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IntegrationBase::precheck
StatusCode precheck(const std::vector< Gaudi::Property< std::string >> &inputs) const
Check if the the desired Gaudi properties are set.
Definition: IntegrationBase.cxx:154
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
EFTrackingFPGAIntegration
The class for enconding RDO to FPGA format.
Definition: BenchmarkAlg.h:28
EFTrackingFPGAIntegration::BenchmarkAlg::m_stripL2GKernelName
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
Definition: BenchmarkAlg.h:86
EFTrackingFPGAIntegration::BenchmarkAlg::m_FPGADataFormatTool
ToolHandle< FPGADataFormatTool > m_FPGADataFormatTool
Tool for formatting FPGA data.
Definition: BenchmarkAlg.h:58
EFTrackingFPGAIntegration::BenchmarkAlg::m_xclbin
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
Definition: BenchmarkAlg.h:71
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
EFTrackingFPGAIntegration::BenchmarkAlg::m_testVectorTool
ToolHandle< TestVectorTool > m_testVectorTool
Tool for preparing test vectors.
Definition: BenchmarkAlg.h:55
IntegrationBase::loadProgram
StatusCode loadProgram(const std::string &xclbin)
Find the xclbin file and load it into the OpenCL program object.
Definition: IntegrationBase.cxx:115
EFTrackingFPGAIntegration::BenchmarkAlg::m_stripClusterKernelName
Gaudi::Property< std::string > m_stripClusterKernelName
Name of the strip clustering kernel.
Definition: BenchmarkAlg.h:80
EFTrackingFPGAIntegration::BenchmarkAlg::m_xaodClusterMaker
ToolHandle< xAODClusterMaker > m_xaodClusterMaker
Tool for creating xAOD containers.
Definition: BenchmarkAlg.h:49
EFTrackingTransient.h
EFTrackingFPGAIntegration::BenchmarkAlg::m_numEvents
std::atomic< ulonglong > m_numEvents
Number of events processed.
Definition: BenchmarkAlg.h:92
EFTrackingTransient::STRIP_BLOCK_BUF_SIZE
constexpr unsigned long STRIP_BLOCK_BUF_SIZE
Definition: EFTrackingTransient.h:35
EFTrackingFPGAIntegration::BenchmarkAlg::m_kernelTime
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
Definition: BenchmarkAlg.h:102
EFTrackingFPGAIntegration::BenchmarkAlg::m_inputStripClusterKey
SG::ReadHandleKey< xAOD::StripClusterContainer > m_inputStripClusterKey
Key to access input strip clusters.
Definition: BenchmarkAlg.h:64
EFTrackingFPGAIntegration::BenchmarkAlg::m_stripInputTime
std::atomic< cl_ulong > m_stripInputTime
Time for strip input buffer write.
Definition: BenchmarkAlg.h:94
EFTrackingFPGAIntegration::BenchmarkAlg::m_pixelClusterKernelName
Gaudi::Property< std::string > m_pixelClusterKernelName
Name of the pixel clustering kernel.
Definition: BenchmarkAlg.h:77
EFTrackingFPGAIntegration::BenchmarkAlg::runPassThrough
StatusCode runPassThrough(std::vector< uint64_t > &pixelChainOutput, std::vector< uint64_t > &stripChainOutput, const EventContext &ctx) const
Definition: BenchmarkAlg.cxx:91
EFTrackingFPGAIntegration::BenchmarkAlg::m_pixelClusteringTime
std::atomic< cl_ulong > m_pixelClusteringTime
Time for pixel clustering.
Definition: BenchmarkAlg.h:95
EFTrackingFPGAIntegration::BenchmarkAlg::m_pixelOutputTime
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
Definition: BenchmarkAlg.h:100
EFTrackingFPGAIntegration::BenchmarkAlg::m_stripL2GTime
std::atomic< cl_ulong > m_stripL2GTime
Time for strip L2G.
Definition: BenchmarkAlg.h:98
IntegrationBase::m_program
cl::Program m_program
Program object containing the kernel.
Definition: IntegrationBase.h:68
EFTrackingFPGAIntegration::BenchmarkAlg::m_edmPrepTime
std::atomic< cl_ulong > m_edmPrepTime
Time for EDM preparation.
Definition: BenchmarkAlg.h:99
EFTrackingFPGAIntegration::BenchmarkAlg::m_runPassThrough
Gaudi::Property< bool > m_runPassThrough
Run the pass-through kernel.
Definition: BenchmarkAlg.h:89
EFTrackingFPGAIntegration::BenchmarkAlg::runDataPrep
StatusCode runDataPrep(std::vector< uint64_t > &pixelChainOutput, std::vector< uint64_t > &stripChainOutput, const EventContext &ctx) const
Definition: BenchmarkAlg.cxx:152