CMS 3D CMS Logo

TracksSoACollection.h
Go to the documentation of this file.
1 #ifndef DataFormats_Track_interface_alpaka_TracksSoACollection_h
2 #define DataFormats_Track_interface_alpaka_TracksSoACollection_h
3 
4 #include <cstdint>
5 #include <alpaka/alpaka.hpp>
13 
14 // TODO: The class is created via inheritance of the PortableCollection.
15 // This is generally discouraged, and should be done via composition.
16 // See: https://github.com/cms-sw/cmssw/pull/40465#discussion_r1067364306
17 
19 
20  template <typename TrackerTraits>
21  using TracksSoACollection = std::conditional_t<std::is_same_v<Device, alpaka::DevCpu>,
24 
25  //Classes definition for Phase1/Phase2/HIonPhase1, to make the classes_def lighter. Not actually used in the code.
26  namespace pixelTrack {
30  } // namespace pixelTrack
31 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
32 
33 namespace cms::alpakatools {
34  template <typename TrackerTraits, typename TDevice>
35  struct CopyToHost<TracksDevice<TrackerTraits, TDevice>> {
36  template <typename TQueue>
37  static auto copyAsync(TQueue& queue, TracksDevice<TrackerTraits, TDevice> const& deviceData) {
39  alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer());
40 #ifdef GPU_DEBUG
41  printf("TracksSoACollection: I'm copying to host.\n");
42 #endif
43  return hostData;
44  }
45  };
46 } // namespace cms::alpakatools
47 
51 
52 #endif // DataFormats_Track_interface_alpaka_TracksSoACollection_h
TracksSoACollection< pixelTopology::Phase1 > TracksSoACollectionPhase1
#define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION)
static auto copyAsync(TQueue &queue, TracksDevice< TrackerTraits, TDevice > const &deviceData)
TracksSoACollection< pixelTopology::HIonPhase1 > TracksSoACollectionHIonPhase1
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, TracksHost< TrackerTraits >, TracksDevice< TrackerTraits, Device > > TracksSoACollection
TracksSoACollection< pixelTopology::Phase2 > TracksSoACollectionPhase2