Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:05:11

0001 #ifndef DataFormats_SiPixelClusterSoA_interface_SiPixelClustersHost_h
0002 #define DataFormats_SiPixelClusterSoA_interface_SiPixelClustersHost_h
0003 
0004 #include <alpaka/alpaka.hpp>
0005 #include "HeterogeneousCore/AlpakaInterface/interface/config.h"
0006 #include "DataFormats/Portable/interface/PortableHostCollection.h"
0007 #include "DataFormats/SiPixelClusterSoA/interface/SiPixelClustersSoA.h"
0008 
0009 // TODO: The class is created via inheritance of the PortableCollection.
0010 // This is generally discouraged, and should be done via composition.
0011 // See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
0012 class SiPixelClustersHost : public PortableHostCollection<SiPixelClustersSoA> {
0013 public:
0014   SiPixelClustersHost() = default;
0015 
0016   template <typename TQueue>
0017   explicit SiPixelClustersHost(size_t maxModules, TQueue queue)
0018       : PortableHostCollection<SiPixelClustersSoA>(maxModules + 1, queue) {}
0019 
0020   void setNClusters(uint32_t nClusters, int32_t offsetBPIX2) {
0021     nClusters_h = nClusters;
0022     offsetBPIX2_h = offsetBPIX2;
0023   }
0024 
0025   uint32_t nClusters() const { return nClusters_h; }
0026   int32_t offsetBPIX2() const { return offsetBPIX2_h; }
0027 
0028 private:
0029   uint32_t nClusters_h = 0;
0030   int32_t offsetBPIX2_h = 0;
0031 };
0032 
0033 #endif  // DataFormats_SiPixelClusterSoA_interface_SiPixelClustersHost_h