Bobby R. Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/39299 )

Change subject: base-stats,python: Expose VectorInfo via Pybind11
......................................................................

base-stats,python: Expose VectorInfo via Pybind11

Change-Id: Iba5fd1dfd1e4c35f01bf4a6fc28481c1be3dd028
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/39299
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/python/pybind11/stats.cc
1 file changed, 20 insertions(+), 0 deletions(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/python/pybind11/stats.cc b/src/python/pybind11/stats.cc
index d07ccbf..50013cf 100644
--- a/src/python/pybind11/stats.cc
+++ b/src/python/pybind11/stats.cc
@@ -67,6 +67,7 @@
     } while (0)

     TRY_CAST(Stats::ScalarInfo);
+    TRY_CAST(Stats::VectorInfo);
     TRY_CAST(Stats::DistInfo);

     return py::cast(info);
@@ -148,6 +149,25 @@
         .def("total", &Stats::ScalarInfo::total)
         ;

+    py::class_<Stats::VectorInfo, Stats::Info,
+               std::unique_ptr<Stats::VectorInfo, py::nodelete>>(
+                    m, "VectorInfo")
+        .def_readwrite("subnames", &Stats::VectorInfo::subnames)
+        .def_readwrite("subdescs", &Stats::VectorInfo::subdescs)
+        .def_property_readonly("size", [](const Stats::VectorInfo &info) {
+                return info.size();
+            })
+        .def_property_readonly("value", [](const Stats::VectorInfo &info) {
+                return info.value();
+            })
+ .def_property_readonly("result", [](const Stats::VectorInfo &info) {
+                return info.result();
+            })
+        .def_property_readonly("total", [](const Stats::VectorInfo &info) {
+                return info.total();
+            })
+        ;
+
     py::class_<Stats::DistInfo, Stats::Info,
                 std::unique_ptr<Stats::DistInfo, py::nodelete>>(
                     m, "DistInfo")

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/39299
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Iba5fd1dfd1e4c35f01bf4a6fc28481c1be3dd028
Gerrit-Change-Number: 39299
Gerrit-PatchSet: 5
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Ciro Santilli <ciro.santi...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <ja...@lowepower.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to