ATLAS Offline Software
TrigITkModuleCuda.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_TRIGITkMODULECUDA_H
6 #define TRIGINDETCUDA_TRIGITkMODULECUDA_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
TrigITkModuleCuda::m_maxDevice
int m_maxDevice
Definition: TrigITkModuleCuda.h:52
TrigInDetAccelCodes.h
TrigAccel::TrigITkModuleID_CUDA
constexpr unsigned int TrigITkModuleID_CUDA
Definition: TrigInDetAccelCodes.h:13
TrigITkModuleCuda::m_d_detmodel_ptrs
std::map< int, unsigned char * > m_d_detmodel_ptrs
Definition: TrigITkModuleCuda.h:50
TrigITkModuleCuda::checkError
void checkError(int code=0) const
Definition: TrigITkModuleCuda.h:36
TrigITkModuleCuda::m_workItemCounters
std::atomic< unsigned int > m_workItemCounters[100]
Definition: TrigITkModuleCuda.h:64
WorkFactory.h
TrigITkModuleCuda::createSeedMakingContext
SeedMakingDeviceContext * createSeedMakingContext(int) const
histSizes.code
code
Definition: histSizes.py:129
TrigITkModuleCuda::configure
bool configure()
TrigITkModuleCuda::createManagedSeedMakingContext
SeedMakingManagedDeviceContext * createManagedSeedMakingContext(int) const
TrigITkModuleCuda::m_timeLine
WorkTimeStampQueue m_timeLine
Definition: TrigITkModuleCuda.h:65
calibdata.exit
exit
Definition: calibdata.py:236
TrigITkModuleCuda
Definition: TrigITkModuleCuda.h:16
TrigAccel::Work
Definition: Work.h:14
WorkTimeStampQueue
Definition: CommonStructures.h:26
TrigITkAccelEDM.h
TrigITkModuleCuda::m_dumpTimeLine
bool m_dumpTimeLine
Definition: TrigITkModuleCuda.h:62
TrigITkModuleCuda::~TrigITkModuleCuda
~TrigITkModuleCuda()
SeedMakingManagedDeviceContext
Definition: device_context.h:45
SeedMakingDeviceContext
Definition: device_context.h:17
TrigITkModuleCuda::createWork
TrigAccel::Work * createWork(int, std::shared_ptr< TrigAccel::OffloadBuffer >)
TrigITkModuleCuda::m_h_detmodel
unsigned char * m_h_detmodel
Definition: TrigITkModuleCuda.h:42
TrigITkModuleCuda::getProvidedAlgs
const std::vector< int > getProvidedAlgs()
TrigAccel::WorkFactory
Definition: WorkFactory.h:16
device_context.h
error
Definition: IImpactPoint3dEstimator.h:70
TrigITkModuleCuda::getFactoryId
virtual int getFactoryId()
Definition: TrigITkModuleCuda.h:30
TrigITkModuleCuda::TrigITkModuleCuda
TrigITkModuleCuda()