CMS 3D CMS Logo

SiPixelDigisSoACollection.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisSoACollection_h
2 #define DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisSoACollection_h
3 
4 #include <cstdint>
5 
6 #include <alpaka/alpaka.hpp>
7 
13 
15 
17  std::conditional_t<std::is_same_v<Device, alpaka::DevCpu>, SiPixelDigisHost, SiPixelDigisDevice<Device>>;
18 
19 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
20 
21 namespace cms::alpakatools {
22  template <typename TDevice>
23  struct CopyToHost<SiPixelDigisDevice<TDevice>> {
24  template <typename TQueue>
25  static auto copyAsync(TQueue &queue, SiPixelDigisDevice<TDevice> const &srcData) {
26  SiPixelDigisHost dstData(srcData.view().metadata().size(), queue);
27  alpaka::memcpy(queue, dstData.buffer(), srcData.buffer());
28  dstData.setNModulesDigis(srcData.nModules(), srcData.nDigis());
29  return dstData;
30  }
31  };
32 } // namespace cms::alpakatools
33 
35 
36 #endif // DataFormats_SiPixelDigiSoA_interface_alpaka_SiPixelDigisSoACollection_h
#define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION)
uint32_t nModules() const
static auto copyAsync(TQueue &queue, SiPixelDigisDevice< TDevice > const &srcData)
void setNModulesDigis(uint32_t nModules, uint32_t nDigis)
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, SiPixelDigisHost, SiPixelDigisDevice< Device > > SiPixelDigisSoACollection
uint32_t nDigis() const