1 #include "DataFormats/PortableTestObjects/interface/TestHostCollection.h" 13 #include <fmt/format.h> 20 expectedXdiff_{iConfig.getUntrackedParameter<
double>(
"expectedXdiff")} {}
26 desc.addUntracked<
double>(
"expectedXdiff", 0.);
31 static void require(
T const&
host,
T const& device,
T const& expectedDiff, std::string_view
name) {
33 if (
diff != expectedDiff) {
34 throw cms::Exception(
"Assert") <<
"Comparison of " <<
name <<
" failed, expected difference " << expectedDiff
35 <<
" but got " <<
diff <<
", host value " <<
host <<
" device value " << device;
43 require(hostData->metadata().size(), deviceData->metadata().size(), 0,
"metadata().size()");
44 auto const hostView = hostData.view();
45 auto const deviceView = deviceData.view();
46 for (
int i = 0;
i < hostData->metadata().size(); ++
i) {
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
double const expectedXdiff_
TestAlpakaHostDeviceCompare(edm::ParameterSet const &iConfig)
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
T getUntrackedParameter(std::string const &, T const &) const
#define DEFINE_FWK_MODULE(type)
edm::EDGetTokenT< portabletest::TestHostCollection > const hostToken_
edm::EDGetTokenT< portabletest::TestHostCollection > const deviceToken_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void analyze(edm::StreamID iStream, edm::Event const &iEvent, edm::EventSetup const &iSetup) const override
static void require(T const &host, T const &device, T const &expectedDiff, std::string_view name)