CMS 3D CMS Logo

SiStripClustersCUDA.h
Go to the documentation of this file.
1 #ifndef CUDADataFormats_SiStripCluster_interface_SiStripClustersCUDA_h
2 #define CUDADataFormats_SiStripCluster_interface_SiStripClustersCUDA_h
3 
8 
9 #include <cuda_runtime.h>
10 
11 class SiStripClustersCUDADevice : public SiStripClustersSOABase<cms::cuda::device::unique_ptr> {
12 public:
13  SiStripClustersCUDADevice() = default;
14  explicit SiStripClustersCUDADevice(uint32_t maxClusters, uint32_t maxStripsPerCluster, cudaStream_t stream);
15  ~SiStripClustersCUDADevice() override = default;
16 
21 
22  struct DeviceView {
23  uint32_t *clusterIndex_;
24  uint32_t *clusterSize_;
25  uint8_t *clusterADCs_;
28  bool *trueCluster_;
29  float *barycenter_;
30  float *charge_;
31  uint32_t nClusters_;
32  uint32_t maxClusterSize_;
33  };
34 
35  DeviceView *view() const { return view_d.get(); }
36  uint32_t nClusters() const { return nClusters_; }
37  uint32_t *nClustersPtr() { return &nClusters_; }
38  uint32_t maxClusterSize() const { return maxClusterSize_; }
39  uint32_t *maxClusterSizePtr() { return &maxClusterSize_; }
40 
41 private:
43  uint32_t nClusters_;
44  uint32_t maxClusterSize_;
45 };
46 
47 class SiStripClustersCUDAHost : public SiStripClustersSOABase<cms::cuda::host::unique_ptr> {
48 public:
49  SiStripClustersCUDAHost() = default;
50  explicit SiStripClustersCUDAHost(const SiStripClustersCUDADevice &clusters_d, cudaStream_t stream);
51  ~SiStripClustersCUDAHost() override = default;
52 
57 };
58 
59 #endif
SiStripClustersCUDADevice & operator=(const SiStripClustersCUDADevice &)=delete
std::uint32_t detId_t
Definition: SiStripTypes.h:8
cms::cuda::device::unique_ptr< DeviceView > view_d
SiStripClustersCUDADevice()=default
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
std::unique_ptr< T, impl::DeviceDeleter > unique_ptr
~SiStripClustersCUDAHost() override=default
SiStripClustersCUDAHost & operator=(const SiStripClustersCUDAHost &)=delete
DeviceView * view() const
~SiStripClustersCUDADevice() override=default
SiStripClustersCUDAHost()=default
std::uint16_t stripId_t
Definition: SiStripTypes.h:12