CMS 3D CMS Logo

ZVertexSoACollection.h
Go to the documentation of this file.
1 #ifndef DataFormats_VertexSoA_interface_ZVertexSoACollection_h
2 #define DataFormats_VertexSoA_interface_ZVertexSoACollection_h
3 
4 #include <cstdint>
5 
6 #include <alpaka/alpaka.hpp>
14 
16 
17  using ZVertexSoACollection =
18  std::conditional_t<std::is_same_v<Device, alpaka::DevCpu>, ZVertexHost, ZVertexDevice<Device>>;
19 
20 } // namespace ALPAKA_ACCELERATOR_NAMESPACE
21 
22 namespace cms::alpakatools {
23  template <typename TDevice>
24  struct CopyToHost<ZVertexDevice<TDevice>> {
25  template <typename TQueue>
26  static auto copyAsync(TQueue& queue, ZVertexDevice<TDevice> const& deviceData) {
27  ZVertexHost hostData(queue);
28  alpaka::memcpy(queue, hostData.buffer(), deviceData.buffer());
29 #ifdef GPU_DEBUG
30  printf("ZVertexSoACollection: I'm copying to host.\n");
31 #endif
32  return hostData;
33  }
34  };
35 } // namespace cms::alpakatools
36 
38 
39 #endif // DataFormats_VertexSoA_interface_ZVertexSoACollection_h
ZVertexHostSoA< zVertex::MAXTRACKS > ZVertexHost
Definition: ZVertexHost.h:27
std::conditional_t< std::is_same_v< Device, alpaka::DevCpu >, ZVertexHost, ZVertexDevice< Device > > ZVertexSoACollection
#define ASSERT_DEVICE_MATCHES_HOST_COLLECTION(DEVICE_COLLECTION, HOST_COLLECTION)
static auto copyAsync(TQueue &queue, ZVertexDevice< TDevice > const &deviceData)