forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPixelCPEFast.h
43 lines (32 loc) · 1.39 KB
/
PixelCPEFast.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
#ifndef RecoLocalTracker_SiPixelRecHits_PixelCPEFast_h
#define RecoLocalTracker_SiPixelRecHits_PixelCPEFast_h
#include <utility>
#include "CUDACore/ESProduct.h"
#include "CUDACore/HostAllocator.h"
#include "CondFormats/pixelCPEforGPU.h"
class PixelCPEFast {
public:
PixelCPEFast(std::string const &path);
~PixelCPEFast() = default;
// The return value can only be used safely in kernels launched on
// the same cudaStream, or after cudaStreamSynchronize.
const pixelCPEforGPU::ParamsOnGPU *getGPUProductAsync(cudaStream_t cudaStream) const;
pixelCPEforGPU::ParamsOnGPU const &getCPUProduct() const { return cpuData_; }
private:
// allocate it with posix malloc to be ocmpatible with cpu wf
std::vector<pixelCPEforGPU::DetParams> m_detParamsGPU;
// std::vector<pixelCPEforGPU::DetParams, cms::cuda::HostAllocator<pixelCPEforGPU::DetParams>> m_detParamsGPU;
pixelCPEforGPU::CommonParams m_commonParamsGPU;
pixelCPEforGPU::LayerGeometry m_layerGeometry;
pixelCPEforGPU::AverageGeometry m_averageGeometry;
pixelCPEforGPU::ParamsOnGPU cpuData_;
struct GPUData {
~GPUData();
// not needed if not used on CPU...
pixelCPEforGPU::ParamsOnGPU h_paramsOnGPU;
pixelCPEforGPU::ParamsOnGPU *d_paramsOnGPU = nullptr; // copy of the above on the Device
};
cms::cuda::ESProduct<GPUData> gpuData_;
void fillParamsForGpu();
};
#endif // RecoLocalTracker_SiPixelRecHits_PixelCPEFast_h