ATLAS Offline Software
SeedMakingWorkCuda.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_SEEDMAKINGWORKCUDA_H
6 #define TRIGINDETCUDA_SEEDMAKINGWORKCUDA_H
7 
8 
9 #include "TrigAccelEvent/Work.h" //base class
10 #include "CommonStructures.h" //for WorkTimeStamp
11 
12 #include <cstdio> // for printf
13 #include <memory> // for shared_ptr
14 
17 
19 
20 public:
21  SeedMakingWorkCuda(unsigned int, SeedMakingDeviceContext*, std::shared_ptr<TrigAccel::OffloadBuffer>,
24  std::shared_ptr<TrigAccel::OffloadBuffer> getOutput();
25  bool run();
26  unsigned int getId() const {
27  return m_workId;
28  }
29 
30 private:
31 
32  inline void checkError() const {
33  cudaError_t error = cudaGetLastError();
34  if(error != cudaSuccess) {
35  printf("CUDA error: %s\n", cudaGetErrorString(error));
36  exit(-1);
37  }
38  };
39 
40  unsigned int m_workId;
42  std::shared_ptr<TrigAccel::OffloadBuffer> m_input, m_output;
44 
46 };
47 
49 
50 public:
51  SeedMakingWorkCudaManaged(unsigned int, SeedMakingManagedDeviceContext*, std::shared_ptr<TrigAccel::OffloadBuffer>,
54  std::shared_ptr<TrigAccel::OffloadBuffer> getOutput();
55  bool run();
56  unsigned int getId() const {
57  return m_workId;
58  }
59 
60 private:
61 
62  inline void checkError() const {
63  cudaError_t error = cudaGetLastError();
64  if(error != cudaSuccess) {
65  printf("CUDA error: %s\n", cudaGetErrorString(error));
66  exit(-1);
67  }
68  };
69 
70  unsigned int m_workId;
72  std::shared_ptr<TrigAccel::OffloadBuffer> m_input, m_output;
74 
76 };
77 
78 #endif
SeedMakingWorkCuda::m_timeLine
WorkTimeStampQueue * m_timeLine
Definition: SeedMakingWorkCuda.h:43
SeedMakingWorkCuda::getId
unsigned int getId() const
Definition: SeedMakingWorkCuda.h:26
CommonStructures.h
SeedMakingWorkCuda::~SeedMakingWorkCuda
~SeedMakingWorkCuda()
SeedMakingWorkCudaManaged::SeedMakingWorkCudaManaged
SeedMakingWorkCudaManaged(unsigned int, SeedMakingManagedDeviceContext *, std::shared_ptr< TrigAccel::OffloadBuffer >, WorkTimeStampQueue *)
SeedMakingWorkCudaManaged::m_input
std::shared_ptr< TrigAccel::OffloadBuffer > m_input
Definition: SeedMakingWorkCuda.h:72
SeedMakingWorkCudaManaged::m_ptCoeff
float m_ptCoeff
Definition: SeedMakingWorkCuda.h:75
SeedMakingWorkCuda::m_context
SeedMakingDeviceContext * m_context
Definition: SeedMakingWorkCuda.h:41
SeedMakingWorkCuda::m_minPt2
float m_minPt2
Definition: SeedMakingWorkCuda.h:45
SeedMakingWorkCudaManaged::m_output
std::shared_ptr< TrigAccel::OffloadBuffer > m_output
Definition: SeedMakingWorkCuda.h:72
SeedMakingWorkCudaManaged::m_minPt2
float m_minPt2
Definition: SeedMakingWorkCuda.h:75
SeedMakingWorkCuda::m_workId
unsigned int m_workId
Definition: SeedMakingWorkCuda.h:38
SeedMakingWorkCudaManaged::m_workId
unsigned int m_workId
Definition: SeedMakingWorkCuda.h:68
SeedMakingWorkCuda
Definition: SeedMakingWorkCuda.h:18
SeedMakingWorkCuda::m_ptCoeff2
float m_ptCoeff2
Definition: SeedMakingWorkCuda.h:45
SeedMakingWorkCuda::run
bool run()
SeedMakingWorkCuda::m_CovMS
float m_CovMS
Definition: SeedMakingWorkCuda.h:45
SeedMakingWorkCuda::m_output
std::shared_ptr< TrigAccel::OffloadBuffer > m_output
Definition: SeedMakingWorkCuda.h:42
SeedMakingWorkCuda::checkError
void checkError() const
Definition: SeedMakingWorkCuda.h:32
calibdata.exit
exit
Definition: calibdata.py:236
SeedMakingWorkCudaManaged::m_timeLine
WorkTimeStampQueue * m_timeLine
Definition: SeedMakingWorkCuda.h:73
SeedMakingWorkCudaManaged::m_context
SeedMakingManagedDeviceContext * m_context
Definition: SeedMakingWorkCuda.h:71
SeedMakingWorkCudaManaged::run
bool run()
TrigAccel::Work
Definition: Work.h:14
WorkTimeStampQueue
Definition: CommonStructures.h:26
SeedMakingWorkCudaManaged::m_maxD0
float m_maxD0
Definition: SeedMakingWorkCuda.h:75
SeedMakingWorkCudaManaged::m_ptCoeff2
float m_ptCoeff2
Definition: SeedMakingWorkCuda.h:75
SeedMakingWorkCudaManaged::m_CovMS
float m_CovMS
Definition: SeedMakingWorkCuda.h:75
SeedMakingWorkCuda::getOutput
std::shared_ptr< TrigAccel::OffloadBuffer > getOutput()
SeedMakingWorkCuda::m_maxD0
float m_maxD0
Definition: SeedMakingWorkCuda.h:45
SeedMakingManagedDeviceContext
Definition: device_context.h:45
SeedMakingDeviceContext
Definition: device_context.h:17
SeedMakingWorkCuda::m_input
std::shared_ptr< TrigAccel::OffloadBuffer > m_input
Definition: SeedMakingWorkCuda.h:42
SeedMakingWorkCudaManaged::~SeedMakingWorkCudaManaged
~SeedMakingWorkCudaManaged()
SeedMakingWorkCuda::SeedMakingWorkCuda
SeedMakingWorkCuda(unsigned int, SeedMakingDeviceContext *, std::shared_ptr< TrigAccel::OffloadBuffer >, WorkTimeStampQueue *)
SeedMakingWorkCudaManaged::checkError
void checkError() const
Definition: SeedMakingWorkCuda.h:62
SeedMakingWorkCudaManaged::getOutput
std::shared_ptr< TrigAccel::OffloadBuffer > getOutput()
SeedMakingWorkCudaManaged
Definition: SeedMakingWorkCuda.h:48
SeedMakingWorkCudaManaged::getId
unsigned int getId() const
Definition: SeedMakingWorkCuda.h:56
error
Definition: IImpactPoint3dEstimator.h:70
SeedMakingWorkCuda::m_ptCoeff
float m_ptCoeff
Definition: SeedMakingWorkCuda.h:45
Work.h