ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAccel
TrigInDetCUDA
src
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>
10
#include <unistd.h>
11
#include "
TrigAccelEvent/WorkFactory.h
"
12
#include "
TrigAccelEvent/TrigITkAccelEDM.h
"
13
#include "
TrigAccelEvent/TrigInDetAccelCodes.h
"
14
15
#include "
device_context.h
"
16
17
class
TrigITkModuleCuda
:
public
TrigAccel::WorkFactory
{
18
19
public
:
20
21
TrigITkModuleCuda
();
22
23
~TrigITkModuleCuda
();
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
() {
32
return
TrigAccel::TrigITkModuleID_CUDA
;
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
53
int
m_maxDevice
;
54
55
// data context allocation / de-allocation
56
57
SeedMakingDeviceContext
*
createSeedMakingContext
(
int
)
const
;
58
59
60
SeedMakingManagedDeviceContext
*
createManagedSeedMakingContext
(
int
)
const
;
61
62
GbtsDeviceContext
*
createGbtsContext
(
int
id
,
const
TrigAccel::ITk::GRAPH_MAKING_INPUT_DATA
*)
const
;
63
64
bool
m_dumpTimeLine
;
65
66
std::atomic<unsigned int>
m_workItemCounters
[100];
//atomic counters for unique Work identification
67
WorkTimeStampQueue
m_timeLine
;
68
};
69
70
#endif
TrigITkAccelEDM.h
TrigInDetAccelCodes.h
WorkFactory.h
TrigAccel::WorkFactory
Definition
WorkFactory.h:16
TrigAccel::Work
Definition
Work.h:14
TrigITkModuleCuda::createGbtsContext
GbtsDeviceContext * createGbtsContext(int id, const TrigAccel::ITk::GRAPH_MAKING_INPUT_DATA *) const
TrigITkModuleCuda::TrigITkModuleCuda
TrigITkModuleCuda()
TrigITkModuleCuda::createWork
TrigAccel::Work * createWork(int, std::shared_ptr< TrigAccel::OffloadBuffer >)
TrigITkModuleCuda::configure
bool configure()
TrigITkModuleCuda::m_timeLine
WorkTimeStampQueue m_timeLine
Definition
TrigITkModuleCuda.h:67
TrigITkModuleCuda::checkError
void checkError(int code=0) const
Definition
TrigITkModuleCuda.h:37
TrigITkModuleCuda::m_d_detmodel_ptrs
std::map< int, unsigned char * > m_d_detmodel_ptrs
Definition
TrigITkModuleCuda.h:51
TrigITkModuleCuda::getFactoryId
virtual int getFactoryId()
Definition
TrigITkModuleCuda.h:31
TrigITkModuleCuda::getProvidedAlgs
const std::vector< int > getProvidedAlgs()
TrigITkModuleCuda::m_workItemCounters
std::atomic< unsigned int > m_workItemCounters[100]
Definition
TrigITkModuleCuda.h:66
TrigITkModuleCuda::~TrigITkModuleCuda
~TrigITkModuleCuda()
TrigITkModuleCuda::m_maxDevice
int m_maxDevice
Definition
TrigITkModuleCuda.h:53
TrigITkModuleCuda::createSeedMakingContext
SeedMakingDeviceContext * createSeedMakingContext(int) const
TrigITkModuleCuda::m_dumpTimeLine
bool m_dumpTimeLine
Definition
TrigITkModuleCuda.h:64
TrigITkModuleCuda::m_h_detmodel
unsigned char * m_h_detmodel
Definition
TrigITkModuleCuda.h:49
TrigITkModuleCuda::createManagedSeedMakingContext
SeedMakingManagedDeviceContext * createManagedSeedMakingContext(int) const
WorkTimeStampQueue
Definition
CommonStructures.h:30
device_context.h
TrigAccel::ITk::GRAPH_MAKING_INPUT_DATA
struct TrigAccel::ITk::GraphMakingInputData GRAPH_MAKING_INPUT_DATA
TrigAccel::TrigITkModuleID_CUDA
constexpr unsigned int TrigITkModuleID_CUDA
Definition
TrigInDetAccelCodes.h:13
error
Definition
IImpactPoint3dEstimator.h:72
GbtsDeviceContext
Definition
device_context.h:80
SeedMakingDeviceContext
Definition
device_context.h:18
SeedMakingManagedDeviceContext
Definition
device_context.h:46
Generated on
for ATLAS Offline Software by
1.17.0