Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2022-11-24 00:02:23

0001 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/chooseDevice.h"
0002 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/EDMetadataSentry.h"
0003 #include "HeterogeneousCore/AlpakaCore/interface/EventCache.h"
0004 #include "HeterogeneousCore/AlpakaCore/interface/QueueCache.h"
0005 
0006 namespace ALPAKA_ACCELERATOR_NAMESPACE {
0007   namespace detail {
0008     EDMetadataSentry::EDMetadataSentry(edm::StreamID streamID) {
0009       auto const& device = detail::chooseDevice(streamID);
0010 #ifdef ALPAKA_ACC_CPU_B_SEQ_T_SEQ_ENABLED
0011       metadata_ = std::make_shared<EDMetadata>(cms::alpakatools::getQueueCache<Queue>().get(device));
0012 #else
0013       metadata_ = std::make_shared<EDMetadata>(cms::alpakatools::getQueueCache<Queue>().get(device),
0014                                                cms::alpakatools::getEventCache<Event>().get(device));
0015 #endif
0016     }
0017 
0018     void EDMetadataSentry::finish() { metadata_->recordEvent(); }
0019   }  // namespace detail
0020 }  // namespace ALPAKA_ACCELERATOR_NAMESPACE