forked from cms-patatrack/pixeltrack-standalone
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSiPixelDigiErrorsCUDA.h
41 lines (31 loc) · 1.66 KB
/
SiPixelDigiErrorsCUDA.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
#ifndef CUDADataFormats_SiPixelDigi_interface_SiPixelDigiErrorsCUDA_h
#define CUDADataFormats_SiPixelDigi_interface_SiPixelDigiErrorsCUDA_h
#include <cuda_runtime.h>
#include "CUDACore/SimpleVector.h"
#include "CUDACore/device_unique_ptr.h"
#include "CUDACore/host_unique_ptr.h"
#include "DataFormats/PixelErrors.h"
class SiPixelDigiErrorsCUDA {
public:
SiPixelDigiErrorsCUDA() = default;
explicit SiPixelDigiErrorsCUDA(size_t maxFedWords, PixelFormatterErrors errors, cudaStream_t stream);
~SiPixelDigiErrorsCUDA() = default;
SiPixelDigiErrorsCUDA(const SiPixelDigiErrorsCUDA&) = delete;
SiPixelDigiErrorsCUDA& operator=(const SiPixelDigiErrorsCUDA&) = delete;
SiPixelDigiErrorsCUDA(SiPixelDigiErrorsCUDA&&) = default;
SiPixelDigiErrorsCUDA& operator=(SiPixelDigiErrorsCUDA&&) = default;
const PixelFormatterErrors& formatterErrors() const { return formatterErrors_h; }
cms::cuda::SimpleVector<PixelErrorCompact>* error() { return error_d.get(); }
cms::cuda::SimpleVector<PixelErrorCompact> const* error() const { return error_d.get(); }
cms::cuda::SimpleVector<PixelErrorCompact> const* c_error() const { return error_d.get(); }
using HostDataError =
std::pair<cms::cuda::SimpleVector<PixelErrorCompact>, cms::cuda::host::unique_ptr<PixelErrorCompact[]>>;
HostDataError dataErrorToHostAsync(cudaStream_t stream) const;
void copyErrorToHostAsync(cudaStream_t stream);
private:
cms::cuda::device::unique_ptr<PixelErrorCompact[]> data_d;
cms::cuda::device::unique_ptr<cms::cuda::SimpleVector<PixelErrorCompact>> error_d;
cms::cuda::host::unique_ptr<cms::cuda::SimpleVector<PixelErrorCompact>> error_h;
PixelFormatterErrors formatterErrors_h;
};
#endif