Skip to content

Commit

Permalink
Migrate test modules from sream to global
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Feb 17, 2023
1 parent b46cde0 commit 9832d04
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions HeterogeneousCore/AlpakaTest/plugins/TestAlpakaAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/stream/EDAnalyzer.h"
#include "FWCore/Framework/interface/global/EDAnalyzer.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "FWCore/ParameterSet/interface/ConfigurationDescriptions.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
Expand Down Expand Up @@ -73,14 +73,14 @@ namespace {

} // namespace

class TestAlpakaAnalyzer : public edm::stream::EDAnalyzer<> {
class TestAlpakaAnalyzer : public edm::global::EDAnalyzer<> {
public:
TestAlpakaAnalyzer(edm::ParameterSet const& config)
: source_{config.getParameter<edm::InputTag>("source")},
token_{consumes(source_)},
expectSize_(config.getParameter<int>("expectSize")) {}

void analyze(edm::Event const& event, edm::EventSetup const&) override {
void analyze(edm::StreamID sid, edm::Event const& event, edm::EventSetup const&) const override {
portabletest::TestHostCollection const& product = event.get(token_);
auto const& view = product.const_view();
auto& mview = product.view();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,19 @@
#include "FWCore/Utilities/interface/StreamID.h"
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/Event.h"
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/EventSetup.h"
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/stream/EDProducer.h"
#include "HeterogeneousCore/AlpakaCore/interface/alpaka/global/EDProducer.h"
#include "HeterogeneousCore/AlpakaInterface/interface/config.h"

#include "TestAlgo.h"

namespace ALPAKA_ACCELERATOR_NAMESPACE {

class TestAlpakaProducer : public stream::EDProducer<> {
class TestAlpakaProducer : public global::EDProducer<> {
public:
TestAlpakaProducer(edm::ParameterSet const& config)
: deviceToken_{produces()}, size_{config.getParameter<int32_t>("size")} {}

void produce(device::Event& event, device::EventSetup const&) override {
void produce(edm::StreamID sid, device::Event& event, device::EventSetup const&) const override {
// run the algorithm, potentially asynchronously
portabletest::TestDeviceCollection deviceProduct{size_, event.queue()};
algo_.fill(event.queue(), deviceProduct);
Expand Down

0 comments on commit 9832d04

Please sign in to comment.