From e87446c9ce7f6cbefcd7bbaff324eebdca10687e Mon Sep 17 00:00:00 2001 From: Mikael Olsson Date: Fri, 15 Dec 2023 17:17:06 +0100 Subject: Change PMU event counter values to use 64-bit The PMU event counter value is an accumulation of 32-bit values during the inference and to ensure the total value fits in the rpmsg message and UAPI, the variable holding the value has been changed to 64-bit. The driver library, Python wrapper and inference runner have been changed accordingly to support the 64-bit values. Change-Id: I09a8e45eb75800c8a787f83abff5a3693148cc15 Signed-off-by: Mikael Olsson --- driver_library/python/src/ethosu_driver/swig/driver.i | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'driver_library/python/src/ethosu_driver/swig/driver.i') diff --git a/driver_library/python/src/ethosu_driver/swig/driver.i b/driver_library/python/src/ethosu_driver/swig/driver.i index 6e0ad25..a8db7c1 100644 --- a/driver_library/python/src/ethosu_driver/swig/driver.i +++ b/driver_library/python/src/ethosu_driver/swig/driver.i @@ -29,6 +29,14 @@ %shared_ptr(EthosU::Buffer); %shared_ptr(EthosU::Network); +%typemap(out) (std::vector) { + PyObject *list = PyList_New($1.size()); + for (size_t i=0; i < $1.size(); ++i) { + PyList_SET_ITEM(list, i, PyLong_FromUnsignedLong($1.at(i))); + } + $result = list; +} + namespace std { %template(UintVector) vector; %template(SizeTVector) vector; @@ -508,7 +516,7 @@ public: Returns: list: PMU event data ") getPmuCounters; - const std::vector getPmuCounters(); + const std::vector getPmuCounters(); %feature("docstring", " -- cgit v1.2.1