CMS 3D CMS Logo

SiPixelClustersSoACollection.h
Go to the documentation of this file.
1 #ifndef DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersSoACollection_h
2 #define DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersSoACollection_h
3 
4 #include <alpaka/alpaka.hpp>
5 
12 
15  std::conditional_t<std::is_same_v<Device, alpaka::DevCpu>, SiPixelClustersHost, SiPixelClustersDevice<Device>>;
16 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
17 
18 namespace cms::alpakatools {
19  template <typename TDevice>
20  struct CopyToHost<SiPixelClustersDevice<TDevice>> {
21  template <typename TQueue>
22  static auto copyAsync(TQueue &queue, SiPixelClustersDevice<TDevice> const &srcData) {
23  SiPixelClustersHost dstData(srcData->metadata().size(), queue);
24  alpaka::memcpy(queue, dstData.buffer(), srcData.buffer());
25  dstData.setNClusters(srcData.nClusters(), srcData.offsetBPIX2());
26 #ifdef GPU_DEBUG //keeping this untiil copies are in the Tracer
27  printf("SiPixelClustersSoACollection: I'm copying to host.\n");
28 #endif
29  return dstData;
30  }
31  };
32 } // namespace cms::alpakatools
33 
35 #endif // DataFormats_SiPixelClusterSoA_interface_alpaka_SiPixelClustersSoACollection_h
void setNClusters(uint32_t nClusters, int32_t offsetBPIX2)
#define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION)
static auto copyAsync(TQueue &queue, SiPixelClustersDevice< TDevice > const &srcData)
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, SiPixelClustersHost, SiPixelClustersDevice< Device > > SiPixelClustersSoACollection