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>
10 #include <unistd.h>
14 
15 #include "device_context.h"
16 
18 
19  public:
20 
22 
24 
25  bool configure();
26 
27  TrigAccel::Work* createWork(int, std::shared_ptr<TrigAccel::OffloadBuffer>);
28 
29  const std::vector<int> getProvidedAlgs();
30 
31  virtual int getFactoryId() {
33  }
34 
35  private:
36 
37  inline void checkError(int code = 0) const {
38  cudaError_t error = cudaGetLastError();
39  if(error != cudaSuccess) {
40  printf("%d CUDA error %d: %s\n", getpid(), code, cudaGetErrorString(error));
41  exit(-1);
42  }
43  };
44 
45  //data structures
46 
47  //1. "const" data: managed by the Factory
48 
49  unsigned char* m_h_detmodel;
50 
51  std::map<int, unsigned char*> m_d_detmodel_ptrs;
52 
54 
55  // data context allocation / de-allocation
56 
58 
59 
61 
62 
64 
65  std::atomic<unsigned int> m_workItemCounters[100];//atomic counters for unique Work identification
67  };
68 
69 #endif
TrigInDetModuleCuda::m_timeLine
WorkTimeStampQueue m_timeLine
Definition: TrigInDetModuleCuda.h:66
TrigInDetModuleCuda::getProvidedAlgs
const std::vector< int > getProvidedAlgs()
TrigInDetAccelCodes.h
TrigInDetModuleCuda
Definition: TrigInDetModuleCuda.h:17
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:51
TrigInDetModuleCuda::m_dumpTimeLine
bool m_dumpTimeLine
Definition: TrigInDetModuleCuda.h:63
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:31
TrigInDetModuleCuda::m_workItemCounters
std::atomic< unsigned int > m_workItemCounters[100]
Definition: TrigInDetModuleCuda.h:65
TrigAccel::WorkFactory
Definition: WorkFactory.h:16
TrigInDetModuleCuda::m_h_detmodel
unsigned char * m_h_detmodel
Definition: TrigInDetModuleCuda.h:43
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:53
TrigInDetModuleCuda::createManagedSeedMakingContext
SeedMakingManagedDeviceContext * createManagedSeedMakingContext(int) const
TrigInDetModuleCuda::checkError
void checkError(int code=0) const
Definition: TrigInDetModuleCuda.h:37