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) {
54 assert(view.metadata().addressOf_x() == view.x());
55 assert(view.metadata().addressOf_x() == &view.x(0));
56 assert(view.metadata().addressOf_x() == &view[0].x());
57 assert(view.metadata().addressOf_y() == view.y());
58 assert(view.metadata().addressOf_y() == &view.y(0));
59 assert(view.metadata().addressOf_y() == &view[0].y());
60 assert(view.metadata().addressOf_z() == view.z());
61 assert(view.metadata().addressOf_z() == &view.z(0));
62 assert(view.metadata().addressOf_z() == &view[0].z());
63 assert(view.metadata().addressOf_id() == view.id());
64 assert(view.metadata().addressOf_id() == &view.id(0));
65 assert(view.metadata().addressOf_id() == &view[0].id());
66 assert(view.metadata().addressOf_m() == view.m());
67 assert(view.metadata().addressOf_m() == &view.m(0).coeffRef(0, 0));
68 assert(view.metadata().addressOf_m() == &view[0].m().coeffRef(0, 0));
69 assert(view.metadata().addressOf_r() == &view.r());
84 auto& mview = product.
view();
85 auto const& cmview = product.
view();
90 msg <<
" data @ " << product.
buffer().data() <<
",\n" 91 <<
" x @ " << view.metadata().addressOf_x() <<
" = " << Column(view.x(), view.metadata().size()) <<
",\n" 92 <<
" y @ " << view.metadata().addressOf_y() <<
" = " << Column(view.y(), view.metadata().size()) <<
",\n" 93 <<
" z @ " << view.metadata().addressOf_z() <<
" = " << Column(view.z(), view.metadata().size()) <<
",\n" 94 <<
" id @ " << view.metadata().addressOf_id() <<
" = " << Column(view.id(), view.metadata().size())
96 <<
" r @ " << view.metadata().addressOf_r() <<
" = " << view.r() <<
'\n' 97 <<
" m @ " << view.metadata().addressOf_m() <<
" = { ... {" << view[1].m()(1,
Eigen::all)
99 msg << std::hex <<
" [y - x] = 0x" 100 <<
reinterpret_cast<intptr_t
>(view.metadata().addressOf_y()) -
101 reinterpret_cast<intptr_t>(view.metadata().addressOf_x())
103 << reinterpret_cast<intptr_t>(view.metadata().addressOf_z()) -
104 reinterpret_cast<intptr_t>(view.metadata().addressOf_y())
106 << reinterpret_cast<intptr_t>(view.metadata().addressOf_id()) -
107 reinterpret_cast<intptr_t>(view.metadata().addressOf_z())
109 << reinterpret_cast<intptr_t>(view.metadata().addressOf_r()) -
110 reinterpret_cast<intptr_t>(view.metadata().addressOf_id())
112 << reinterpret_cast<intptr_t>(view.metadata().addressOf_m()) -
113 reinterpret_cast<intptr_t>(view.metadata().addressOf_r());
116 checkViewAddresses(view);
117 checkViewAddresses(mview);
118 checkViewAddresses(cmview);
120 const portabletest::Matrix matrix{{1, 2, 3, 4, 5, 6}, {2, 4, 6, 8, 10, 12}, {3, 6, 9, 12, 15, 18}};
122 for (int32_t
i = 0;
i < view.metadata().size(); ++
i) {
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
const edm::EDGetTokenT< portabletest::TestHostCollection > token_
void analyze(edm::Event const &event, edm::EventSetup const &) override
Eigen::Matrix< double, 3, 6 > Matrix
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)