-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #40849 from makortel/alpakaDeviceEventExpose
Allow access to const edm::{Event,EventSetup} from device::{Event,EventSetup}
- Loading branch information
Showing
8 changed files
with
83 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
HeterogeneousCore/AlpakaTest/interface/TestHostOnlyHelperClass.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#ifndef HeterogeneousCore_AlpakaTest_interface_TestHostOnlyHelperClass_h | ||
#define HeterogeneousCore_AlpakaTest_interface_TestHostOnlyHelperClass_h | ||
|
||
#include "DataFormats/TestObjects/interface/ToyProducts.h" | ||
#include "FWCore/Framework/interface/ConsumesCollector.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/EventSetup.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
#include "FWCore/Utilities/interface/EDGetToken.h" | ||
#include "FWCore/Utilities/interface/ESGetToken.h" | ||
#include "HeterogeneousCore/AlpakaTest/interface/AlpakaESTestRecords.h" | ||
#include "HeterogeneousCore/AlpakaTest/interface/ESTestData.h" | ||
|
||
namespace cms::alpakatest { | ||
class TestHostOnlyHelperClass { | ||
public: | ||
TestHostOnlyHelperClass(edm::ParameterSet const& iConfig, edm::ConsumesCollector iC); | ||
|
||
static void fillPSetDescription(edm::ParameterSetDescription& iDesc); | ||
|
||
int run(edm::Event const& iEvent, edm::EventSetup const& iSetup) const; | ||
|
||
private: | ||
edm::EDGetTokenT<edmtest::IntProduct> const edToken_; | ||
edm::ESGetToken<cms::alpakatest::ESTestDataA, AlpakaESTestRecordA> const esToken_; | ||
}; | ||
} // namespace cms::alpakatest | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
HeterogeneousCore/AlpakaTest/src/TestHostOnlyHelperClass.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h" | ||
#include "HeterogeneousCore/AlpakaTest/interface/TestHostOnlyHelperClass.h" | ||
|
||
namespace cms::alpakatest { | ||
TestHostOnlyHelperClass::TestHostOnlyHelperClass(edm::ParameterSet const& iConfig, edm::ConsumesCollector iC) | ||
: edToken_(iC.consumes(iConfig.getParameter<edm::InputTag>("intSource"))), esToken_(iC.esConsumes()) {} | ||
|
||
void TestHostOnlyHelperClass::fillPSetDescription(edm::ParameterSetDescription& iDesc) { | ||
iDesc.add<edm::InputTag>("intSource"); | ||
} | ||
|
||
int TestHostOnlyHelperClass::run(edm::Event const& iEvent, edm::EventSetup const& iSetup) const { | ||
auto const& ed = iEvent.get(edToken_); | ||
auto const& es = iSetup.getData(esToken_); | ||
|
||
return ed.value + es.value(); | ||
} | ||
} // namespace cms::alpakatest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters