aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2023-12-15 17:25:53 +0100
committerMikael Olsson <mikael.olsson@arm.com>2023-12-21 10:32:34 +0100
commit4c675f63b03b0a4db2a37e35bebde5464d9c5f79 (patch)
tree7a4406f43196477cdbdd67602b9c68dfc1d391df
parent244a310a799a414c38c7e9f4bb757319f9bb6866 (diff)
downloadethos-u-core-platform-4c675f63b03b0a4db2a37e35bebde5464d9c5f79.tar.gz
Change to accumulate PMU values in message handler
Currently the message_handler_openamp overwrites the PMU values in the response message each time operators are offloaded the NPU in an inference request. To instead get the total PMU values for all the times the NPU was used during the inference, the PMU values are now accumulated instead. Change-Id: I7fb8697e441b362f2f6da8a26536ba51d17c6b4c Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
-rw-r--r--applications/message_handler_openamp/inference_runner.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/applications/message_handler_openamp/inference_runner.cpp b/applications/message_handler_openamp/inference_runner.cpp
index c290773..b462b44 100644
--- a/applications/message_handler_openamp/inference_runner.cpp
+++ b/applications/message_handler_openamp/inference_runner.cpp
@@ -191,8 +191,8 @@ void ethosu_inference_end(ethosu_driver *drv, void *userArg) {
// Get cycle counter
if (response.pmu_cycle_counter_enable) {
- uint64_t cycleCount = ETHOSU_PMU_Get_CCNTR(drv);
- response.pmu_cycle_counter_count = cycleCount;
+ uint64_t cycleCount = ETHOSU_PMU_Get_CCNTR(drv);
+ response.pmu_cycle_counter_count += cycleCount;
ethosu_profiler_add_to_pmu_cycles(&context->profiler_context, cycleCount);
}
@@ -202,8 +202,8 @@ void ethosu_inference_end(ethosu_driver *drv, void *userArg) {
// Get event counters
int i;
for (i = 0; i < numEvents; i++) {
- uint32_t eventValue = ETHOSU_PMU_Get_EVCNTR(drv, i);
- response.pmu_event_count[i] = eventValue;
+ uint32_t eventValue = ETHOSU_PMU_Get_EVCNTR(drv, i);
+ response.pmu_event_count[i] += eventValue;
ethosu_profiler_add_to_pmu_event(&context->profiler_context, i, eventValue);
}