ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Trigger
TrigAccel
TrigInDetCUDA
src
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>
11
#include "
TrigAccelEvent/WorkFactory.h
"
12
#include "
TrigAccelEvent/TrigInDetAccelEDM.h
"
13
#include "
TrigAccelEvent/TrigInDetAccelCodes.h
"
14
15
#include "
device_context.h
"
16
17
class
TrigInDetModuleCuda
:
public
TrigAccel::WorkFactory
{
18
19
public
:
20
21
TrigInDetModuleCuda
();
22
23
~TrigInDetModuleCuda
();
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::TrigInDetModuleID_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
63
bool
m_dumpTimeLine
;
64
65
std::atomic<unsigned int>
m_workItemCounters
[100];
//atomic counters for unique Work identification
66
WorkTimeStampQueue
m_timeLine
;
67
};
68
69
#endif
TrigInDetAccelCodes.h
TrigInDetAccelEDM.h
WorkFactory.h
TrigAccel::WorkFactory
Definition
WorkFactory.h:16
TrigAccel::Work
Definition
Work.h:14
TrigInDetModuleCuda::checkError
void checkError(int code=0) const
Definition
TrigInDetModuleCuda.h:37
TrigInDetModuleCuda::m_maxDevice
int m_maxDevice
Definition
TrigInDetModuleCuda.h:53
TrigInDetModuleCuda::createSeedMakingContext
SeedMakingDeviceContext * createSeedMakingContext(int) const
TrigInDetModuleCuda::createManagedSeedMakingContext
SeedMakingManagedDeviceContext * createManagedSeedMakingContext(int) const
TrigInDetModuleCuda::m_h_detmodel
unsigned char * m_h_detmodel
Definition
TrigInDetModuleCuda.h:49
TrigInDetModuleCuda::TrigInDetModuleCuda
TrigInDetModuleCuda()
TrigInDetModuleCuda::configure
bool configure()
TrigInDetModuleCuda::~TrigInDetModuleCuda
~TrigInDetModuleCuda()
TrigInDetModuleCuda::getProvidedAlgs
const std::vector< int > getProvidedAlgs()
TrigInDetModuleCuda::getFactoryId
virtual int getFactoryId()
Definition
TrigInDetModuleCuda.h:31
TrigInDetModuleCuda::m_dumpTimeLine
bool m_dumpTimeLine
Definition
TrigInDetModuleCuda.h:63
TrigInDetModuleCuda::createWork
TrigAccel::Work * createWork(int, std::shared_ptr< TrigAccel::OffloadBuffer >)
TrigInDetModuleCuda::m_timeLine
WorkTimeStampQueue m_timeLine
Definition
TrigInDetModuleCuda.h:66
TrigInDetModuleCuda::m_d_detmodel_ptrs
std::map< int, unsigned char * > m_d_detmodel_ptrs
Definition
TrigInDetModuleCuda.h:51
TrigInDetModuleCuda::m_workItemCounters
std::atomic< unsigned int > m_workItemCounters[100]
Definition
TrigInDetModuleCuda.h:65
WorkTimeStampQueue
Definition
CommonStructures.h:30
device_context.h
TrigAccel::TrigInDetModuleID_CUDA
constexpr unsigned int TrigInDetModuleID_CUDA
Definition
TrigInDetAccelCodes.h:12
error
Definition
IImpactPoint3dEstimator.h:72
SeedMakingDeviceContext
Definition
device_context.h:18
SeedMakingManagedDeviceContext
Definition
device_context.h:46
Generated on
for ATLAS Offline Software by
1.17.0