ATLAS Offline Software
TrigInDetModuleCuda.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGINDETCUDA_TRIGINDETMODULECUDA_H
6 #define TRIGINDETCUDA_TRIGINDETMODULECUDA_H
7 
8 #include <map>
9 #include <atomic>
13 
14 #include "device_context.h"
15 
17 
18  public:
19 
21 
23 
24  bool configure();
25 
26  TrigAccel::Work* createWork(int, std::shared_ptr<TrigAccel::OffloadBuffer>);
27 
28  const std::vector<int> getProvidedAlgs();
29 
30  virtual int getFactoryId() {
32  }
33 
34  private:
35 
36  inline void checkError(int code = 0) const {
37  cudaError_t error = cudaGetLastError();
38  if(error != cudaSuccess) {
39  printf("%d CUDA error %d: %s\n", getpid(), code, cudaGetErrorString(error));
40  exit(-1);
41  }
42  };
43 
44  //data structures
45 
46  //1. "const" data: managed by the Factory
47 
48  unsigned char* m_h_detmodel;
49 
50  std::map<int, unsigned char*> m_d_detmodel_ptrs;
51 
53 
54  // data context allocation / de-allocation
55 
57 
58 
60 
61 
63 
64  std::atomic<unsigned int> m_workItemCounters[100];//atomic counters for unique Work identification
66  };
67 
68 #endif
TrigInDetModuleCuda::m_timeLine
WorkTimeStampQueue m_timeLine
Definition: TrigInDetModuleCuda.h:65
TrigInDetModuleCuda::getProvidedAlgs
const std::vector< int > getProvidedAlgs()
TrigInDetAccelCodes.h
TrigInDetModuleCuda
Definition: TrigInDetModuleCuda.h:16
WorkFactory.h
TrigAccel::TrigInDetModuleID_CUDA
constexpr unsigned int TrigInDetModuleID_CUDA
Definition: TrigInDetAccelCodes.h:12
histSizes.code
code
Definition: histSizes.py:129
TrigInDetModuleCuda::configure
bool configure()
TrigInDetModuleCuda::m_d_detmodel_ptrs
std::map< int, unsigned char * > m_d_detmodel_ptrs
Definition: TrigInDetModuleCuda.h:50
TrigInDetModuleCuda::m_dumpTimeLine
bool m_dumpTimeLine
Definition: TrigInDetModuleCuda.h:62
TrigInDetModuleCuda::~TrigInDetModuleCuda
~TrigInDetModuleCuda()
TrigInDetModuleCuda::TrigInDetModuleCuda
TrigInDetModuleCuda()
calibdata.exit
exit
Definition: calibdata.py:236
TrigInDetModuleCuda::createSeedMakingContext
SeedMakingDeviceContext * createSeedMakingContext(int) const
TrigAccel::Work
Definition: Work.h:14
WorkTimeStampQueue
Definition: CommonStructures.h:26
SeedMakingManagedDeviceContext
Definition: device_context.h:45
SeedMakingDeviceContext
Definition: device_context.h:17
TrigInDetModuleCuda::getFactoryId
virtual int getFactoryId()
Definition: TrigInDetModuleCuda.h:30
TrigInDetModuleCuda::m_workItemCounters
std::atomic< unsigned int > m_workItemCounters[100]
Definition: TrigInDetModuleCuda.h:64
TrigAccel::WorkFactory
Definition: WorkFactory.h:16
TrigInDetModuleCuda::m_h_detmodel
unsigned char * m_h_detmodel
Definition: TrigInDetModuleCuda.h:42
device_context.h
error
Definition: IImpactPoint3dEstimator.h:70
TrigInDetModuleCuda::createWork
TrigAccel::Work * createWork(int, std::shared_ptr< TrigAccel::OffloadBuffer >)
TrigInDetAccelEDM.h
TrigInDetModuleCuda::m_maxDevice
int m_maxDevice
Definition: TrigInDetModuleCuda.h:52
TrigInDetModuleCuda::createManagedSeedMakingContext
SeedMakingManagedDeviceContext * createManagedSeedMakingContext(int) const
TrigInDetModuleCuda::checkError
void checkError(int code=0) const
Definition: TrigInDetModuleCuda.h:36