ATLAS Offline Software
F110IntegrationAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3  */
4 
6 #include "AthenaKernel/Chrono.h"
8 #include <xrt/xrt_bo.h>
9 #include <xrt/xrt_device.h>
10 #include <xrt/xrt_kernel.h>
11 #include <xrt/xrt_uuid.h>
12 
14 {
16  {
17  ATH_MSG_INFO("Running on the FPGA accelerator");
18 
20 
21  ATH_CHECK(m_chronoSvc.retrieve());
22 
23  {
24  Athena::Chrono chrono("Platform and device initlize", m_chronoSvc.get());
26  }
27 
28  {
29  Athena::Chrono chrono("CL::loadProgram", m_chronoSvc.get());
31  }
32  ATH_MSG_INFO("loading "<<m_xclbin);
33 
34 
37 
40 
41  cl_int err = 0;
42 
43  // Get the list of CUs
44  std::vector<std::string> listofCUs;
45  getListofCUs(listofCUs);
46 
47  // Create kernels for each one of CUs that is inside device
48  for (const auto& cuName: listofCUs)
49  {
50  // Pixel clustering
51  if(cuName.find(m_pixelClusterKernelName.value()) != std::string::npos) m_pixelClusterKernels.emplace_back(cl::Kernel(m_program, cuName.c_str()));
52 
53  // Strip clustering
54  else if(cuName.find(m_stripClusterKernelName.value()) != std::string::npos) m_stripClusterKernels.emplace_back(cl::Kernel(m_program, cuName.c_str()));
55 
56  // Strip L2G
57  else if(cuName.find(m_stripL2GKernelName.value()) != std::string::npos) m_stripL2GKernels.emplace_back(cl::Kernel(m_program, cuName.c_str()));
58 
59  // EDM prep
60  else if(cuName.find(m_pixelEdmKernelName.value()) != std::string::npos) m_pixelEDMKernels.emplace_back(cl::Kernel(m_program, cuName.c_str()));
61 
62  else if(cuName.find(m_stripEdmKernelName.value()) != std::string::npos) m_stripEDMKernels.emplace_back(cl::Kernel(m_program, cuName.c_str()));
63 
64  else
65  {
66  ATH_MSG_WARNING("Do not recognize kernel name: "<<cuName);
67  }
68 
69  }
70 
71  ATH_MSG_INFO(m_pixelClusterKernelName.value()<<" size: "<<m_pixelClusterKernels.size());
72  ATH_MSG_INFO(m_stripClusterKernelName.value()<<" size: "<<m_stripClusterKernels.size());
73  ATH_MSG_INFO(m_stripL2GKernelName.value()<<" size: "<<m_stripL2GKernels.size());
74  ATH_MSG_INFO(m_pixelEdmKernelName.value()<<" size: "<<m_pixelEDMKernels.size());
75  ATH_MSG_INFO(m_stripEdmKernelName.value()<<" size: "<<m_stripEDMKernels.size());
76 
77 
78  // Strip
79  // Set vector size to be = to # of CUs
80  m_stripClusterEndEvents.resize(m_stripClusterKernels.size());
81  m_stripL2GEndEvents.resize(m_stripL2GKernels.size());
82  m_stripEDMEndEvents.resize(m_stripEDMKernels.size());
83 
84  // Pixel
85  m_pixelClusterEndEvents.resize(m_pixelClusterKernels.size());
86  m_pixelEDMEndEvents.resize(m_pixelEDMKernels.size());
87 
88  unsigned int nthreads = m_FPGAThreads.value();
89 
90  if(m_FPGAThreads.value() < 1){
91  nthreads = SG::getNSlots();
92  }
93 
94  // create the buffers
95  for(unsigned int i = 0; i < nthreads; i++)
96  {
97  // Input
98  m_pixelClusterInputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_ONLY, EFTrackingTransient::PIXEL_CONTAINER_INPUT_BUF_SIZE * sizeof(uint64_t), NULL, &err));
99  m_stripClusterInputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_ONLY, EFTrackingTransient::STRIP_CONTAINER_INPUT_BUF_SIZE * sizeof(uint64_t), NULL, &err));
100 
101  m_stripClusterOutputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err));
102  m_pixelClusterEDMOutputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_WRITE,EFTrackingTransient::PIXEL_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err));
103  m_stripClusterEDMOutputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err));
104 
105  m_stripL2GOutputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err));
106  m_stripL2GEDMOutputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_BLOCK_BUF_SIZE * sizeof(uint64_t), NULL, &err));
107  // EDMPrep
108  m_edmPixelOutputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::PIXEL_CONTAINER_BUF_SIZE * sizeof(uint64_t), NULL, &err));
109  m_edmStripOutputBufferList.push_back(cl::Buffer(m_context, CL_MEM_READ_WRITE, EFTrackingTransient::STRIP_CONTAINER_BUF_SIZE * sizeof(uint64_t), NULL, &err));
110  }
111 
112 
113 
114  m_acc_queue = cl::CommandQueue(m_context, m_accelerator, CL_QUEUE_PROFILING_ENABLE | CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE, &err);
115 
116  if (err != 0) return StatusCode::FAILURE;
117  return StatusCode::SUCCESS;
118  }
119 
120  std::vector<cl::Event> F110IntegrationAlg::getDepVector(std::vector<cl::Event> &endEvents, size_t cu) const {
121  std::vector<cl::Event> deps;
122 
123  cl::Event event = endEvents[cu];
124 
125  if (event() != NULL)
126  {
127  // Event exists
128  deps.push_back(event);
129  }
130 
131  return deps;
132  }
133 
134 
135  StatusCode F110IntegrationAlg::execute(const EventContext &ctx) const
136  {
137  ATH_MSG_DEBUG("Executing F110IntegrationAlg");
138  m_numEvents++;
139 
141  auto pixelInput = SG::get(m_FPGAPixelRDO, ctx);
142  auto stripInput = SG::get(m_FPGAStripRDO, ctx);
143 
144  // logic
145  unsigned int nthreads = m_FPGAThreads.value();
146 
147  if(m_FPGAThreads.value() < 1){
148  nthreads = SG::getNSlots();
149  }
150 
151  size_t bufferIndex = ctx.slot() % nthreads;
152 
153  // Get index for each of the kernels
154  size_t pixelClusterIndex = ctx.slot() % m_pixelClusterKernels.size();
155  size_t stripClusterIndex = ctx.slot() % m_stripClusterKernels.size();
156  size_t stripL2GIndex = ctx.slot() % m_stripL2GKernels.size();
157  size_t pixelEDMIndex = ctx.slot() % m_pixelEDMKernels.size();
158  size_t stripEDMIndex = ctx.slot() % m_stripEDMKernels.size();
159 
160 
161  // Explicit mutex needed so we don't block multithreading from functioning properly but end the execute function in accordance with FPGA hardware resource utilization
162  std::unique_lock lock(m_fpgaHandleMtx);
163 
164 
165  ATH_MSG_DEBUG("F100 Thread number "<<ctx.slot()<<" running on buffer "<<bufferIndex<<" pixelClusterIndex: "<< pixelClusterIndex<<" stripClusterIndex: "<< stripClusterIndex<<" stripL2GIndex: "<< stripL2GIndex<<" pixelEDMIndex: "<< pixelEDMIndex<<" stripEDMIndex: "<< stripEDMIndex);
166 
167 
168  // Grab buffers
169  cl::Buffer pixelClusterInputBuffer = m_pixelClusterInputBufferList[bufferIndex];
170  cl::Buffer stripClusterInputBuffer = m_stripClusterInputBufferList[bufferIndex];
171  cl::Buffer stripClusterOutputBuffer = m_stripClusterOutputBufferList[bufferIndex];
172  cl::Buffer pixelClusterEDMOutputBuffer = m_pixelClusterEDMOutputBufferList[bufferIndex];
173  cl::Buffer stripClusterEDMOutputBuffer = m_stripClusterEDMOutputBufferList[bufferIndex];
174  cl::Buffer stripL2GOutputBuffer = m_stripL2GOutputBufferList[bufferIndex];
175  cl::Buffer stripL2GEDMOutputBuffer = m_stripL2GEDMOutputBufferList[bufferIndex];
176  cl::Buffer edmPixelOutputBuffer = m_edmPixelOutputBufferList[bufferIndex];
177  cl::Buffer edmStripOutputBuffer = m_edmStripOutputBufferList[bufferIndex];
178 
179 
180  // Grab kernels
181  cl::Kernel &pixelClusteringKernel = m_pixelClusterKernels[pixelClusterIndex];
182  cl::Kernel &pixelEdmPrepKernel = m_pixelEDMKernels[pixelEDMIndex];
183 
184  cl::Kernel &stripClusteringKernel = m_stripClusterKernels[stripClusterIndex];
185  cl::Kernel &stripL2GKernel = m_stripL2GKernels[stripL2GIndex];
186  cl::Kernel &stripEdmPrepKernel = m_stripEDMKernels[stripEDMIndex];
187 
188 
189  // Set kernel args
190  pixelClusteringKernel.setArg<cl::Buffer>(0, pixelClusterInputBuffer);
191  pixelClusteringKernel.setArg<cl::Buffer>(1, pixelClusterEDMOutputBuffer);
192 
193  stripClusteringKernel.setArg<cl::Buffer>(0, stripClusterInputBuffer);
194  stripClusteringKernel.setArg<cl::Buffer>(1, stripClusterOutputBuffer);
195  stripClusteringKernel.setArg<cl::Buffer>(2, stripClusterEDMOutputBuffer);
196  stripClusteringKernel.setArg<unsigned int>(3, (*stripInput).size());
197 
198  stripL2GKernel.setArg<cl::Buffer>(0, stripClusterOutputBuffer);
199  stripL2GKernel.setArg<cl::Buffer>(1, stripClusterEDMOutputBuffer);
200  stripL2GKernel.setArg<cl::Buffer>(2, stripL2GOutputBuffer);
201  stripL2GKernel.setArg<cl::Buffer>(3, stripL2GEDMOutputBuffer);
202 
203  pixelEdmPrepKernel.setArg<cl::Buffer>(0, pixelClusterEDMOutputBuffer);
204  pixelEdmPrepKernel.setArg<cl::Buffer>(1, edmPixelOutputBuffer);
205  stripEdmPrepKernel.setArg<cl::Buffer>(0, stripL2GEDMOutputBuffer);
206  stripEdmPrepKernel.setArg<cl::Buffer>(1, edmStripOutputBuffer);
207 
208 
209  // Start memory transfers while respecting event deps
210  // Note that no explicit mutex is needed anymore due to the m_fpgaHandleMtx mutex
211  std::vector<cl::Event> writePixelInputDeps = getDepVector(m_pixelClusterEndEvents, pixelClusterIndex);
212  std::vector<cl::Event> writeStripInputDeps = getDepVector(m_stripClusterEndEvents, stripClusterIndex);
213 
214  cl::Event writePixelInputEvt;
215  cl::Event writeStripInputEvt;
216  m_acc_queue.enqueueWriteBuffer(pixelClusterInputBuffer, CL_FALSE, 0, sizeof(uint64_t) * (*pixelInput).size(), (*pixelInput).data(), &writePixelInputDeps, &writePixelInputEvt);
217  m_acc_queue.enqueueWriteBuffer(stripClusterInputBuffer, CL_FALSE, 0, sizeof(uint64_t) * (*stripInput).size(), (*stripInput).data(), &writeStripInputDeps, &writeStripInputEvt);
218 
219  std::vector<cl::Event> pixelClusteringDeps = { writePixelInputEvt };
220  std::vector<cl::Event> stripClusteringDeps = { writeStripInputEvt };
221 
222  cl::Event pixelClusteringEvt;
223  cl::Event stripClusteringEvt;
224  cl::Event pixelL2GEvt;
225  cl::Event stripL2GEvt;
226  cl::Event edmPrepEvt;
227  cl::Event pixelEdmPrepEvt;
228  cl::Event stripEdmPrepEvt;
229 
230  {
231  Athena::Chrono chrono("Kernel execution", m_chronoSvc.get());
232 
233  // CLUSTERING
234  m_acc_queue.enqueueTask(pixelClusteringKernel, &pixelClusteringDeps, &pixelClusteringEvt);
235  m_acc_queue.enqueueTask(stripClusteringKernel, &stripClusteringDeps, &stripClusteringEvt);
236 
237  // Track the clustering end events
238  m_pixelClusterEndEvents[pixelClusterIndex] = pixelClusteringEvt;
239  m_stripClusterEndEvents[stripClusterIndex] = stripClusteringEvt;
240 
241  std::vector<cl::Event> stripL2GDeps = getDepVector(m_stripL2GEndEvents, stripClusterIndex);
242  stripL2GDeps.push_back(stripClusteringEvt);
243 
244  m_acc_queue.enqueueTask(stripL2GKernel, &stripL2GDeps, &stripL2GEvt);
245 
246  m_stripL2GEndEvents[stripClusterIndex] = stripL2GEvt;
247 
248  // EDM PREP
249  std::vector<cl::Event> pixelEdmPrepDeps = getDepVector(m_pixelEDMEndEvents, pixelClusterIndex);
250  pixelEdmPrepDeps.push_back(pixelClusteringEvt);
251 
252  // Run discrete EDM prep kernels for F110
253  std::vector<cl::Event> stripEdmPrepDeps = getDepVector(m_stripEDMEndEvents, stripClusterIndex);
254  stripEdmPrepDeps.push_back(stripL2GEvt);
255 
256  m_acc_queue.enqueueTask(stripEdmPrepKernel, &stripEdmPrepDeps, &stripEdmPrepEvt);
257  m_acc_queue.enqueueTask(pixelEdmPrepKernel, &pixelEdmPrepDeps, &pixelEdmPrepEvt);
258 
259  }
260 
261  // READ OUTPUTS
262  cl::Event readPixelOutputEvt;
263  cl::Event readStripOutputEvt;
264  std::vector<cl::Event> readPixelOutputDeps;
265  std::vector<cl::Event> readStripOutputDeps;
266 
267  readPixelOutputDeps.push_back(pixelEdmPrepEvt);
268  readStripOutputDeps.push_back(stripEdmPrepEvt);
269 
270 
272  ATH_CHECK(FPGAPixelOutput.record(std::make_unique<std::vector<uint64_t> >(EFTrackingTransient::PIXEL_CONTAINER_BUF_SIZE, 0)));
273 
275  ATH_CHECK(FPGAStripOutput.record(std::make_unique<std::vector<uint64_t> >(EFTrackingTransient::STRIP_CONTAINER_BUF_SIZE, 0)));
276 
277  m_acc_queue.enqueueReadBuffer(edmPixelOutputBuffer, CL_FALSE, 0, sizeof(uint64_t) * (*FPGAPixelOutput).size(), (*FPGAPixelOutput).data(), &readPixelOutputDeps, &readPixelOutputEvt);
278  m_acc_queue.enqueueReadBuffer(edmStripOutputBuffer, CL_FALSE, 0, sizeof(uint64_t) * (*FPGAStripOutput).size(), (*FPGAStripOutput).data(), &readStripOutputDeps, &readStripOutputEvt);
279 
280 
281  // Unlocks mutex so other events can handle their FPGA interactions while this event is waiting
282  lock.unlock();
283 
284 
285  // Wait for the reading to finish before terminating the event
286  std::vector<cl::Event> terminationDeps = { readPixelOutputEvt, readStripOutputEvt };
287  cl::Event::waitForEvents(terminationDeps);
288 
289  if(pixelInput->size() == 6) (*FPGAPixelOutput)[0] = 0; // if no pixel input, set the first element to 0
290  if(stripInput->size() == 6) (*FPGAStripOutput)[0] = 0; // if no strip input, set the first element to 0
291 
292 
293  // calculate the time for the kernel execution
294  // get the time of writing pixel input buffer
295  cl_ulong pixel_input_time = writePixelInputEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - writePixelInputEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
296  m_pixelInputTime += pixel_input_time;
297  ATH_MSG_DEBUG("Pixel input buffer write time: " << pixel_input_time / 1e6 << " ms");
298 
299  // get the time of writing strip input buffer
300  cl_ulong strip_input_time = writeStripInputEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - writeStripInputEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
301  m_stripInputTime += strip_input_time;
302  ATH_MSG_DEBUG("Strip input buffer write time: " << strip_input_time / 1e6 << " ms");
303 
304  // get the time of pixel clustering
305  cl_ulong pixel_clustering_time = pixelClusteringEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - pixelClusteringEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
306  m_pixelClusteringTime += pixel_clustering_time;
307  ATH_MSG_DEBUG("Pixel clustering time: " << pixel_clustering_time / 1e6 << " ms");
308 
309  // get the time of strip clustering
310  cl_ulong strip_clustering_time = stripClusteringEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - stripClusteringEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
311  m_stripClusteringTime += strip_clustering_time;
312  ATH_MSG_DEBUG("Strip clustering time: " << strip_clustering_time / 1e6 << " ms");
313 
314 
315  // get the time of strip L2G
316  cl_ulong strip_l2g_time = stripL2GEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - stripL2GEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
317  m_stripL2GTime += strip_l2g_time;
318  ATH_MSG_DEBUG("Strip L2G time: " << strip_l2g_time / 1e6 << " ms");
319 
320  // get the time of EDMPrep
321 
322  cl_ulong pixel_edm_prep_time = pixelEdmPrepEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - pixelEdmPrepEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
323  cl_ulong strip_edm_prep_time = stripEdmPrepEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - stripEdmPrepEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
324 
325  m_pixelEdmPrepTime += pixel_edm_prep_time;
326  ATH_MSG_DEBUG("PixelEDMPrep time: " << pixel_edm_prep_time / 1e6 << " ms");
327 
328  m_stripEdmPrepTime += strip_edm_prep_time;
329  ATH_MSG_DEBUG("StripEDMPrep time: " << strip_edm_prep_time / 1e6 << " ms");
330 
331  // get the time of the whole kernel execution
332  cl_ulong kernel_start = pixelClusteringEvt.getProfilingInfo<CL_PROFILING_COMMAND_QUEUED>();
333  cl_ulong kernel_end = std::max(pixelEdmPrepEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>(), stripEdmPrepEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>());
334  m_kernelTime += (kernel_end - kernel_start);
335  ATH_MSG_DEBUG("Kernel execution time: " << (kernel_end - kernel_start) / 1e6 << " ms");
336 
337  // get the time of reading pixel output buffer
338  cl_ulong pixel_output_time = readPixelOutputEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - readPixelOutputEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
339  m_pixelOutputTime += pixel_output_time;
340  ATH_MSG_DEBUG("Pixel output buffer read time: " << pixel_output_time / 1e6 << " ms");
341 
342  // get the time of reading strip output buffer
343  cl_ulong strip_output_time = readStripOutputEvt.getProfilingInfo<CL_PROFILING_COMMAND_END>() - readStripOutputEvt.getProfilingInfo<CL_PROFILING_COMMAND_START>();
344  m_stripOutputTime += strip_output_time;
345  ATH_MSG_DEBUG("Strip output buffer read time: " << strip_output_time / 1e6 << " ms");
346 
347 
348  return StatusCode::SUCCESS;
349  }
350 
352  {
353 
354  ATH_MSG_INFO("Finalizing F110IntegrationAlg");
355  ATH_MSG_INFO("Number of events: " << m_numEvents);
356 
357  if(m_numEvents > 0){
358  ATH_MSG_INFO("Pixel input ave time: " << m_pixelInputTime / m_numEvents / 1e6 << " ms");
359  ATH_MSG_INFO("Strip input ave time: " << m_stripInputTime / m_numEvents / 1e6 << " ms");
360  ATH_MSG_INFO("Pixel clustering ave time: " << m_pixelClusteringTime / m_numEvents / 1e6 << " ms");
361  ATH_MSG_INFO("Strip clustering ave time: " << m_stripClusteringTime / m_numEvents / 1e6 << " ms");
362  ATH_MSG_INFO("Strip L2G ave time: " << m_stripL2GTime / m_numEvents / 1e6 << " ms");
363  ATH_MSG_INFO("PixelEDMPrep ave time: " << m_pixelEdmPrepTime / m_numEvents / 1e6 << " ms");
364  ATH_MSG_INFO("StripEDMPrep ave time: " << m_stripEdmPrepTime / m_numEvents / 1e6 << " ms");
365  ATH_MSG_INFO("Kernel execution ave time: " << m_kernelTime / m_numEvents / 1e6 << " ms");
366  ATH_MSG_INFO("Pixel output ave time: " << m_pixelOutputTime / m_numEvents / 1e6 << " ms");
367  ATH_MSG_INFO("Strip output ave time: " << m_stripOutputTime / m_numEvents / 1e6 << " ms");
368  }
369 
370  return StatusCode::SUCCESS;
371  }
372 
373  void F110IntegrationAlg::getListofCUs(std::vector<std::string>& cuNames)
374  {
375  xrt::xclbin xrt_xclbin(m_xclbin);
376 
377  ATH_MSG_INFO("xsa name: "<<xrt_xclbin.get_xsa_name());
378  ATH_MSG_INFO("fpga name: "<<xrt_xclbin.get_fpga_device_name());
379  ATH_MSG_INFO("uuid: "<<xrt_xclbin.get_uuid().to_string());
380 
381  for (const xrt::xclbin::kernel &kernel : xrt_xclbin.get_kernels()) {
382  const std::string& kernelName = kernel.get_name();
383 
384  ATH_MSG_INFO("kernelName: "<<kernelName);
385 
386 
387  for (const xrt::xclbin::ip &computeUnit : kernel.get_cus()) {
388  const std::string& computeUnitName = computeUnit.get_name();
389  const std::string computeUnitIsolatedName = computeUnitName.substr(kernelName.size() + 1);
390 
391  const std::string computeUnitUsableName = kernelName + ":{" + computeUnitIsolatedName + "}";
392 
393  ATH_MSG_INFO("CU name: "<<computeUnitUsableName);
394  cuNames.push_back(computeUnitUsableName);
395  }
396  }
397 
398  }
399 
400 } // namespace EFTrackingFPGAIntegration
EFTrackingFPGAIntegration::F110IntegrationAlg::m_stripInputTime
std::atomic< cl_ulong > m_stripInputTime
Time for strip input buffer write.
Definition: F110IntegrationAlg.h:88
EFTrackingFPGAIntegration::F110IntegrationAlg::m_stripEdmKernelName
Gaudi::Property< std::string > m_stripEdmKernelName
Name of the FPGA kernel.
Definition: F110IntegrationAlg.h:62
EFTrackingFPGAIntegration::F110IntegrationAlg::m_acc_queue
cl::CommandQueue m_acc_queue
Definition: F110IntegrationAlg.h:113
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
EFTrackingTransient::PIXEL_CONTAINER_BUF_SIZE
constexpr unsigned long PIXEL_CONTAINER_BUF_SIZE
Definition: EFTrackingTransient.h:36
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
make_unique
std::unique_ptr< T > make_unique(Args &&... args)
Definition: SkimmingToolEXOT5.cxx:23
EFTrackingFPGAIntegration::F110IntegrationAlg::m_pixelInputTime
std::atomic< cl_ulong > m_pixelInputTime
Time for pixel input buffer write.
Definition: F110IntegrationAlg.h:87
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
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::F110IntegrationAlg::m_stripL2GTime
std::atomic< cl_ulong > m_stripL2GTime
Time for strip L2G.
Definition: F110IntegrationAlg.h:91
EFTrackingFPGAIntegration::F110IntegrationAlg::m_fpgaHandleMtx
std::mutex m_fpgaHandleMtx
Definition: F110IntegrationAlg.h:70
EFTrackingFPGAIntegration::F110IntegrationAlg::m_kernelTime
std::atomic< cl_ulong > m_kernelTime
Time for kernel execution.
Definition: F110IntegrationAlg.h:96
python.RatesEmulationExample.lock
lock
Definition: RatesEmulationExample.py:148
Chrono.h
Exception-safe IChronoSvc caller.
EFTrackingFPGAIntegration::F110IntegrationAlg::m_pixelOutputTime
std::atomic< cl_ulong > m_pixelOutputTime
Time for pixel output buffer read.
Definition: F110IntegrationAlg.h:94
EFTrackingFPGAIntegration::F110IntegrationAlg::m_FPGAStripOutput
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGAStripOutput
Definition: F110IntegrationAlg.h:54
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
EFTrackingFPGAIntegration::F110IntegrationAlg::m_xclbin
Gaudi::Property< std::string > m_xclbin
Path and name of the xclbin file.
Definition: F110IntegrationAlg.h:58
Athena::Chrono
Exception-safe IChronoSvc caller.
Definition: Chrono.h:50
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
dqt_zlumi_pandas.err
err
Definition: dqt_zlumi_pandas.py:183
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::get
const T * get(const ReadCondHandleKey< T > &key, const EventContext &ctx)
Convenience function to retrieve an object given a ReadCondHandleKey.
Definition: ReadCondHandle.h:287
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
EFTrackingTransient::PIXEL_CONTAINER_INPUT_BUF_SIZE
constexpr unsigned long PIXEL_CONTAINER_INPUT_BUF_SIZE
Definition: EFTrackingTransient.h:42
find_tgc_unfilled_channelids.ip
ip
Definition: find_tgc_unfilled_channelids.py:3
EFTrackingFPGAIntegration::F110IntegrationAlg::m_pixelEdmKernelName
Gaudi::Property< std::string > m_pixelEdmKernelName
Name of the FPGA kernel.
Definition: F110IntegrationAlg.h:60
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
EFTrackingFPGAIntegration::F110IntegrationAlg::m_pixelClusterKernelName
Gaudi::Property< std::string > m_pixelClusterKernelName
Name of the pixel clustering kernel.
Definition: F110IntegrationAlg.h:64
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::F110IntegrationAlg::m_pixelEdmPrepTime
std::atomic< cl_ulong > m_pixelEdmPrepTime
Time for pixel EDM preparation.
Definition: F110IntegrationAlg.h:92
EFTrackingFPGAIntegration::F110IntegrationAlg::getListofCUs
void getListofCUs(std::vector< std::string > &cuNames)
Definition: F110IntegrationAlg.cxx:373
IntegrationBase::loadProgram
StatusCode loadProgram(const std::string &xclbin)
Find the xclbin file and load it into the OpenCL program object.
Definition: IntegrationBase.cxx:115
EFTrackingTransient::STRIP_CONTAINER_INPUT_BUF_SIZE
constexpr unsigned long STRIP_CONTAINER_INPUT_BUF_SIZE
Definition: EFTrackingTransient.h:43
EFTrackingFPGAIntegration::F110IntegrationAlg::m_FPGAStripRDO
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAStripRDO
Definition: F110IntegrationAlg.h:51
EFTrackingFPGAIntegration::F110IntegrationAlg::initialize
virtual StatusCode initialize() override final
Detect the OpenCL devices and prepare OpenCL context.
Definition: F110IntegrationAlg.cxx:15
EFTrackingFPGAIntegration::F110IntegrationAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override final
Should be overriden by derived classes to perform meaningful work.
Definition: F110IntegrationAlg.cxx:135
EFTrackingFPGAIntegration::F110IntegrationAlg::m_chronoSvc
ServiceHandle< IChronoSvc > m_chronoSvc
Service for timing the algorithm.
Definition: F110IntegrationAlg.h:48
EFTrackingTransient::STRIP_BLOCK_BUF_SIZE
constexpr unsigned long STRIP_BLOCK_BUF_SIZE
Definition: EFTrackingTransient.h:35
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:73
EFTrackingFPGAIntegration::F110IntegrationAlg::m_FPGAPixelRDO
SG::ReadHandleKey< std::vector< uint64_t > > m_FPGAPixelRDO
Definition: F110IntegrationAlg.h:50
EFTrackingFPGAIntegration::F110IntegrationAlg::finalize
virtual StatusCode finalize() override final
Definition: F110IntegrationAlg.cxx:351
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
EFTrackingFPGAIntegration::F110IntegrationAlg::m_stripClusterKernelName
Gaudi::Property< std::string > m_stripClusterKernelName
Name of the strip clustering kernel.
Definition: F110IntegrationAlg.h:66
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
EFTrackingFPGAIntegration::F110IntegrationAlg::getDepVector
std::vector< cl::Event > getDepVector(std::vector< cl::Event > &endEvents, size_t cu) const
Definition: F110IntegrationAlg.cxx:120
SG::getNSlots
size_t getNSlots()
Return the number of event slots.
Definition: SlotSpecificObj.cxx:64
EFTrackingFPGAIntegration::F110IntegrationAlg::m_pixelClusteringTime
std::atomic< cl_ulong > m_pixelClusteringTime
Time for pixel clustering.
Definition: F110IntegrationAlg.h:89
EFTrackingFPGAIntegration::F110IntegrationAlg::m_stripEdmPrepTime
std::atomic< cl_ulong > m_stripEdmPrepTime
Time for strip EDM preparation.
Definition: F110IntegrationAlg.h:93
SlotSpecificObj.h
Maintain a set of objects, one per slot.
EFTrackingFPGAIntegration::F110IntegrationAlg::m_stripL2GKernelName
Gaudi::Property< std::string > m_stripL2GKernelName
Name of the strip L2G kernelS.
Definition: F110IntegrationAlg.h:68
F110IntegrationAlg.h
EFTrackingFPGAIntegration::F110IntegrationAlg::m_FPGAThreads
Gaudi::Property< int > m_FPGAThreads
Definition: F110IntegrationAlg.h:56
IntegrationBase::m_program
cl::Program m_program
Program object containing the kernel.
Definition: IntegrationBase.h:68
EFTrackingFPGAIntegration::F110IntegrationAlg::m_FPGAPixelOutput
SG::WriteHandleKey< std::vector< uint64_t > > m_FPGAPixelOutput
Definition: F110IntegrationAlg.h:53
EFTrackingFPGAIntegration::F110IntegrationAlg::m_stripOutputTime
std::atomic< cl_ulong > m_stripOutputTime
Time for strip output buffer read.
Definition: F110IntegrationAlg.h:95
EFTrackingFPGAIntegration::F110IntegrationAlg::m_numEvents
std::atomic< ulonglong > m_numEvents
Number of events processed.
Definition: F110IntegrationAlg.h:86
EFTrackingFPGAIntegration::F110IntegrationAlg::m_stripClusteringTime
std::atomic< cl_ulong > m_stripClusteringTime
Time for strip clustering.
Definition: F110IntegrationAlg.h:90