CMS 3D CMS Logo

TrackingRecHitsSoACollection.h
Go to the documentation of this file.
1 #ifndef DataFormats_RecHits_interface_alpakaTrackingRecHitsSoACollection
2 #define DataFormats_RecHits_interface_alpakaTrackingRecHitsSoACollection
3 
4 #include <cstdint>
5 #include <alpaka/alpaka.hpp>
12 
14 
15  template <typename TrackerTraits>
16  using TrackingRecHitsSoACollection = std::conditional_t<std::is_same_v<Device, alpaka::DevCpu>,
19 
20  //Classes definition for Phase1/Phase2, to make the classes_def lighter. Not actually used in the code.
24 
25 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
26 
27 namespace cms::alpakatools {
28  template <typename TrackerTraits, typename TDevice>
29  struct CopyToHost<TrackingRecHitDevice<TrackerTraits, TDevice>> {
30  template <typename TQueue>
31  static auto copyAsync(TQueue& queue, TrackingRecHitDevice<TrackerTraits, TDevice> const& deviceData) {
32  TrackingRecHitHost<TrackerTraits> hostData(deviceData.view().metadata().size(), queue);
33  alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer());
34 #ifdef GPU_DEBUG
35  printf("TrackingRecHitsSoACollection: I'm copying to host.\n");
36 #endif
37  return hostData;
38  }
39  };
40 } // namespace cms::alpakatools
41 
45 
46 #endif // DataFormats_RecHits_interface_alpakaTrackingRecHitsSoACollection
static auto copyAsync(TQueue &queue, TrackingRecHitDevice< TrackerTraits, TDevice > const &deviceData)
#define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION)
TrackingRecHitsSoACollection< pixelTopology::Phase2 > TrackingRecHitSoAPhase2
TrackingRecHitsSoACollection< pixelTopology::Phase1 > TrackingRecHitSoAPhase1
TrackingRecHitsSoACollection< pixelTopology::HIonPhase1 > TrackingRecHitSoAHIonPhase1
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, TrackingRecHitHost< TrackerTraits >, TrackingRecHitDevice< TrackerTraits, Device > > TrackingRecHitsSoACollection