aboutsummaryrefslogtreecommitdiff
path: root/applications/message_handler_openamp/inference_runner.cpp
diff options
context:
space:
mode:
authorMikael Olsson <mikael.olsson@arm.com>2024-02-12 13:30:31 +0100
committerMikael Olsson <mikael.olsson@arm.com>2024-02-13 09:28:24 +0100
commit687095113aaafd4207e1acaacd6475174a60b4dc (patch)
treeb8fab2298b58056c015948579d44b3928ef25174 /applications/message_handler_openamp/inference_runner.cpp
parent34b190bf804639805fb958c637c365dd831916b7 (diff)
downloadethos-u-core-platform-687095113aaafd4207e1acaacd6475174a60b4dc.tar.gz
Update rpmsg type names in message handler
With the restructuring of the Linux kernel driver source files, some macros and types in the rpmsg header was renamed to better namespace their usage. The message handler openamp application has been updated accordingly. Change-Id: Ibfc11ced58cddd23463bb2060d658cc9b374e035 Signed-off-by: Mikael Olsson <mikael.olsson@arm.com>
Diffstat (limited to 'applications/message_handler_openamp/inference_runner.cpp')
-rw-r--r--applications/message_handler_openamp/inference_runner.cpp20
1 files changed, 10 insertions, 10 deletions
diff --git a/applications/message_handler_openamp/inference_runner.cpp b/applications/message_handler_openamp/inference_runner.cpp
index b462b44..bf07819 100644
--- a/applications/message_handler_openamp/inference_runner.cpp
+++ b/applications/message_handler_openamp/inference_runner.cpp
@@ -1,5 +1,5 @@
/*
- * SPDX-FileCopyrightText: Copyright 2022-2023 Arm Limited and/or its affiliates <open-source-office@arm.com>
+ * SPDX-FileCopyrightText: Copyright 2022-2024 Arm Limited and/or its affiliates <open-source-office@arm.com>
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the License); you may
@@ -78,7 +78,7 @@ void InferenceRunner::inferenceTask(void *param) {
auto &rpmsg = message->rpmsg;
switch (rpmsg.header.type) {
- case EthosU::ETHOSU_CORE_MSG_INFERENCE_REQ: {
+ case EthosU::ETHOSU_RPMSG_INFERENCE_REQ: {
_this->handleInferenceRequest(message->src, rpmsg.header.msg_id, rpmsg.inf_req);
break;
}
@@ -93,15 +93,15 @@ void InferenceRunner::inferenceTask(void *param) {
void InferenceRunner::handleInferenceRequest(const uint32_t src,
const uint64_t msgId,
- const EthosU::ethosu_core_msg_inference_req &request) {
+ const EthosU::ethosu_rpmsg_inference_req &request) {
auto jobContext = new JobContext(
- new Message(src, EthosU::ETHOSU_CORE_MSG_INFERENCE_RSP, msgId, sizeof(EthosU::ethosu_core_msg_inference_rsp)));
+ new Message(src, EthosU::ETHOSU_RPMSG_INFERENCE_RSP, msgId, sizeof(EthosU::ethosu_rpmsg_inference_rsp)));
auto &response = jobContext->rsp->rpmsg.inf_rsp;
// Setup PMU configuration
response.pmu_cycle_counter_enable = request.pmu_cycle_counter_enable;
- for (int i = 0; i < ETHOSU_CORE_PMU_MAX; i++) {
+ for (int i = 0; i < ETHOSU_RPMSG_PMU_MAX; i++) {
response.pmu_event_config[i] = request.pmu_event_config[i];
}
@@ -113,7 +113,7 @@ void InferenceRunner::handleInferenceRequest(const uint32_t src,
// Send response rpmsg
response.ofm_count = job.output.size();
- response.status = failed ? EthosU::ETHOSU_CORE_STATUS_ERROR : EthosU::ETHOSU_CORE_STATUS_OK;
+ response.status = failed ? EthosU::ETHOSU_RPMSG_STATUS_ERROR : EthosU::ETHOSU_RPMSG_STATUS_OK;
for (size_t i = 0; i < job.output.size(); ++i) {
response.ofm_size[i] = job.output[i].size;
@@ -123,7 +123,7 @@ void InferenceRunner::handleInferenceRequest(const uint32_t src,
delete jobContext;
}
-InferenceProcess::InferenceJob InferenceRunner::makeInferenceJob(const EthosU::ethosu_core_msg_inference_req &request,
+InferenceProcess::InferenceJob InferenceRunner::makeInferenceJob(const EthosU::ethosu_rpmsg_inference_req &request,
JobContext &jobContext) {
InferenceProcess::InferenceJob job;
@@ -155,7 +155,7 @@ void ethosu_inference_begin(ethosu_driver *drv, void *userArg) {
auto &response = context->rsp->rpmsg.inf_rsp;
// Calculate maximum number of events
- const int numEvents = std::min(static_cast<int>(ETHOSU_PMU_Get_NumEventCounters()), ETHOSU_CORE_PMU_MAX);
+ const int numEvents = std::min(static_cast<int>(ETHOSU_PMU_Get_NumEventCounters()), ETHOSU_RPMSG_PMU_MAX);
// Enable PMU
ETHOSU_PMU_Enable(drv);
@@ -197,7 +197,7 @@ void ethosu_inference_end(ethosu_driver *drv, void *userArg) {
}
// Calculate maximum number of events
- const int numEvents = std::min(static_cast<int>(ETHOSU_PMU_Get_NumEventCounters()), ETHOSU_CORE_PMU_MAX);
+ const int numEvents = std::min(static_cast<int>(ETHOSU_PMU_Get_NumEventCounters()), ETHOSU_RPMSG_PMU_MAX);
// Get event counters
int i;
@@ -207,7 +207,7 @@ void ethosu_inference_end(ethosu_driver *drv, void *userArg) {
ethosu_profiler_add_to_pmu_event(&context->profiler_context, i, eventValue);
}
- for (; i < ETHOSU_CORE_PMU_MAX; i++) {
+ for (; i < ETHOSU_RPMSG_PMU_MAX; i++) {
response.pmu_event_config[i] = 0;
response.pmu_event_count[i] = 0;
}