Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-02-14 04:11:51

0001 #ifndef HeterogeneousCore_AlpakaTest_plugins_alpaka_TestHelperClass_h
0002 #define HeterogeneousCore_AlpakaTest_plugins_alpaka_TestHelperClass_h
0003 
0004 #include "DataFormats/PortableTestObjects/interface/TestHostCollection.h"
0005 #include "DataFormats/PortableTestObjects/interface/alpaka/TestDeviceCollection.h"
0006 #include "FWCore/Framework/interface/ConsumesCollector.h"
0007 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0008 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/EDPutToken.h"
0009 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/ESGetToken.h"
0010 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/Event.h"
0011 #include "HeterogeneousCore/AlpakaCore/interface/alpaka/EventSetup.h"
0012 #include "HeterogeneousCore/AlpakaInterface/interface/config.h"
0013 #include "HeterogeneousCore/AlpakaTest/interface/AlpakaESTestRecords.h"
0014 #include "HeterogeneousCore/AlpakaTest/interface/ESTestData.h"
0015 #include "HeterogeneousCore/AlpakaTest/interface/alpaka/AlpakaESTestData.h"
0016 
0017 namespace ALPAKA_ACCELERATOR_NAMESPACE {
0018   class TestHelperClass {
0019   public:
0020     TestHelperClass(edm::ParameterSet const& iConfig, edm::ConsumesCollector iC);
0021 
0022     static void fillPSetDescription(edm::ParameterSetDescription& iDesc);
0023 
0024     void makeAsync(device::Event const& iEvent, device::EventSetup const& iSetup);
0025 
0026     portabletest::TestHostCollection moveFrom() { return std::move(hostProduct_); }
0027     portabletest::TestHostMultiCollection2 moveFromMulti2() { return std::move(hostProductMulti2_); }
0028     portabletest::TestHostMultiCollection3 moveFromMulti3() { return std::move(hostProductMulti3_); }
0029 
0030   private:
0031     const device::EDGetToken<portabletest::TestDeviceCollection> getToken_;
0032     const device::EDGetToken<portabletest::TestDeviceMultiCollection2> getTokenMulti2_;
0033     const device::EDGetToken<portabletest::TestDeviceMultiCollection3> getTokenMulti3_;
0034     const edm::ESGetToken<cms::alpakatest::ESTestDataA, AlpakaESTestRecordA> esTokenHost_;
0035     const device::ESGetToken<AlpakaESTestDataCDevice, AlpakaESTestRecordC> esTokenDevice_;
0036 
0037     // hold the output product between acquire() and produce()
0038     portabletest::TestHostCollection hostProduct_;
0039     portabletest::TestHostMultiCollection2 hostProductMulti2_;
0040     portabletest::TestHostMultiCollection3 hostProductMulti3_;
0041   };
0042 }  // namespace ALPAKA_ACCELERATOR_NAMESPACE
0043 
0044 #endif