-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathSiPixelFedCablingMapGPUWrapper.h
46 lines (34 loc) · 1.41 KB
/
SiPixelFedCablingMapGPUWrapper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef RecoLocalTracker_SiPixelClusterizer_SiPixelFedCablingMapGPUWrapper_h
#define RecoLocalTracker_SiPixelClusterizer_SiPixelFedCablingMapGPUWrapper_h
#include "CUDACore/ESProduct.h"
#include "CUDACore/HostAllocator.h"
#include "CUDACore/device_unique_ptr.h"
#include "CondFormats/SiPixelFedCablingMapGPU.h"
#include <cuda_runtime.h>
#include <set>
class SiPixelFedCablingMapGPUWrapper {
public:
explicit SiPixelFedCablingMapGPUWrapper(SiPixelFedCablingMapGPU const &cablingMap,
std::vector<unsigned char> modToUnp);
~SiPixelFedCablingMapGPUWrapper();
bool hasQuality() const { return hasQuality_; }
// returns pointer to GPU memory
const SiPixelFedCablingMapGPU *getGPUProductAsync(cudaStream_t cudaStream) const;
// returns pointer to GPU memory
const unsigned char *getModToUnpAllAsync(cudaStream_t cudaStream) const;
private:
std::vector<unsigned char, cms::cuda::HostAllocator<unsigned char>> modToUnpDefault;
bool hasQuality_;
SiPixelFedCablingMapGPU *cablingMapHost = nullptr; // pointer to struct in CPU
struct GPUData {
~GPUData();
SiPixelFedCablingMapGPU *cablingMapDevice = nullptr; // pointer to struct in GPU
};
cms::cuda::ESProduct<GPUData> gpuData_;
struct ModulesToUnpack {
~ModulesToUnpack();
unsigned char *modToUnpDefault = nullptr; // pointer to GPU
};
cms::cuda::ESProduct<ModulesToUnpack> modToUnp_;
};
#endif