CMS 3D CMS Logo

SiPixelDigisCUDA.h
Go to the documentation of this file.
1 #ifndef CUDADataFormats_SiPixelDigi_interface_SiPixelDigisCUDA_h
2 #define CUDADataFormats_SiPixelDigi_interface_SiPixelDigisCUDA_h
3 
4 #include <cuda_runtime.h>
5 
11 
13  SOA_COLUMN(int32_t, clus),
14  SOA_COLUMN(uint32_t, pdigi),
15  SOA_COLUMN(uint32_t, rawIdArr),
16  SOA_COLUMN(uint16_t, adc),
17  SOA_COLUMN(uint16_t, xx),
18  SOA_COLUMN(uint16_t, yy),
19  SOA_COLUMN(uint16_t, moduleId))
20 
24 
25 // TODO: The class is created via inheritance of the PortableDeviceCollection.
26 // This is generally discouraged, and should be done via composition.
27 // See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
29 public:
30  SiPixelDigisCUDA() = default;
31  explicit SiPixelDigisCUDA(size_t maxFedWords, cudaStream_t stream)
32  : PortableDeviceCollection<SiPixelDigisSoALayout<>>(maxFedWords + 1, stream) {}
33  ~SiPixelDigisCUDA() = default;
34 
35  SiPixelDigisCUDA(SiPixelDigisCUDA &&) = default;
36  SiPixelDigisCUDA &operator=(SiPixelDigisCUDA &&) = default;
37 
38  void setNModulesDigis(uint32_t nModules, uint32_t nDigis) {
39  nModules_h = nModules;
40  nDigis_h = nDigis;
41  }
42 
43  uint32_t nModules() const { return nModules_h; }
44  uint32_t nDigis() const { return nDigis_h; }
45 
46 private:
47  uint32_t nModules_h = 0;
48  uint32_t nDigis_h = 0;
49 };
50 
51 #endif // CUDADataFormats_SiPixelDigi_interface_SiPixelDigisCUDA_h
uint32_t T const *__restrict__ uint32_t const *__restrict__ int32_t int Histo::index_type cudaStream_t stream
#define GENERATE_SOA_LAYOUT(CLASS,...)
Definition: SoALayout.h:426
SiPixelDigisCUDASOA::View SiPixelDigisCUDASOAView
Namespace of DDCMS conversion namespace.
uint16_t *__restrict__ uint16_t const *__restrict__ uint32_t const *__restrict__ uint32_t *__restrict__ uint32_t const *__restrict__ moduleId
SiPixelDigisCUDASOA::ConstView SiPixelDigisCUDASOAConstView
#define SOA_COLUMN(TYPE, NAME)
Definition: SoACommon.h:554
uint16_t *__restrict__ uint16_t const *__restrict__ adc