ATLAS Offline Software
Loading...
Searching...
No Matches
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
void checkError(int code=0) const
SeedMakingDeviceContext * createSeedMakingContext(int) const
SeedMakingManagedDeviceContext * createManagedSeedMakingContext(int) const
unsigned char * m_h_detmodel
const std::vector< int > getProvidedAlgs()
TrigAccel::Work * createWork(int, std::shared_ptr< TrigAccel::OffloadBuffer >)
WorkTimeStampQueue m_timeLine
std::map< int, unsigned char * > m_d_detmodel_ptrs
std::atomic< unsigned int > m_workItemCounters[100]
constexpr unsigned int TrigInDetModuleID_CUDA