3 #include "DataFormats/PortableTestObjects/interface/TestHostCollection.h" 22 void print(std::ostream&
out)
const {
29 buffer <<
", " << data_[1];
32 buffer <<
", " << data_[2];
47 std::ostream& operator<<(std::ostream& out, Column<T>
const&
column) {
53 void checkViewAddresses(
T const&
view) {
67 assert(
view.metadata().addressOf_m() == &
view.m(0).coeffRef(0, 0));
68 assert(
view.metadata().addressOf_m() == &
view[0].m().coeffRef(0, 0));
86 auto& mview = product.
view();
87 auto const& cmview = product.
view();
91 <<
view.metadata().size();
97 msg <<
" data @ " << product.
buffer().data() <<
",\n" 98 <<
" x @ " <<
view.metadata().addressOf_x() <<
" = " << Column(
view.x(),
view.metadata().size()) <<
",\n" 99 <<
" y @ " <<
view.metadata().addressOf_y() <<
" = " << Column(
view.y(),
view.metadata().size()) <<
",\n" 100 <<
" z @ " <<
view.metadata().addressOf_z() <<
" = " << Column(
view.z(),
view.metadata().size()) <<
",\n" 101 <<
" id @ " <<
view.metadata().addressOf_id() <<
" = " << Column(
view.id(),
view.metadata().size())
103 <<
" r @ " <<
view.metadata().addressOf_r() <<
" = " <<
view.r() <<
'\n' 104 <<
" m @ " <<
view.metadata().addressOf_m() <<
" = { ... {" <<
view[1].m()(1,
Eigen::all)
106 msg << std::hex <<
" [y - x] = 0x" 107 <<
reinterpret_cast<intptr_t
>(
view.metadata().addressOf_y()) -
108 reinterpret_cast<intptr_t>(
view.metadata().addressOf_x())
110 << reinterpret_cast<intptr_t>(
view.metadata().addressOf_z()) -
111 reinterpret_cast<intptr_t>(
view.metadata().addressOf_y())
113 << reinterpret_cast<intptr_t>(
view.metadata().addressOf_id()) -
114 reinterpret_cast<intptr_t>(
view.metadata().addressOf_z())
116 << reinterpret_cast<intptr_t>(
view.metadata().addressOf_r()) -
117 reinterpret_cast<intptr_t>(
view.metadata().addressOf_id())
119 << reinterpret_cast<intptr_t>(
view.metadata().addressOf_m()) -
120 reinterpret_cast<intptr_t>(
view.metadata().addressOf_r());
123 checkViewAddresses(
view);
124 checkViewAddresses(mview);
125 checkViewAddresses(cmview);
127 const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
129 for (int32_t
i = 0;
i <
view.metadata().size(); ++
i) {
142 desc.add<
int>(
"expectSize", -1)
143 ->setComment(
"Expected size of the input collection. Values < 0 mean the check is not performed. Default: -1");
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< portabletest::TestHostCollection > token_
Eigen::Matrix< double, 3, 6 > Matrix
void analyze(edm::StreamID sid, edm::Event const &event, edm::EventSetup const &) const override
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
ConstView const & const_view() const
const edm::InputTag source_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
#define DEFINE_FWK_MODULE(type)
char data[epos_bytes_allocation]
TestAlpakaAnalyzer(edm::ParameterSet const &config)