summaryrefslogtreecommitdiff
path: root/source/use_case/img_class
diff options
context:
space:
mode:
authorKshitij Sisodia <kshitij.sisodia@arm.com>2021-05-07 16:08:14 +0100
committerKshitij Sisodia <kshitij.sisodia@arm.com>2021-05-07 17:28:51 +0100
commitf9c19eaa9ab11e4409679fc6d2862c89410493a7 (patch)
treeb791a4c03f1fe986a2ac32593a3dc817ae3f247a /source/use_case/img_class
parent2181d0ac35f30202985a877950c88325ff665f6b (diff)
downloadml-embedded-evaluation-kit-f9c19eaa9ab11e4409679fc6d2862c89410493a7.tar.gz
MLECO-1860: Support for Arm GNU Embedded Toolchain
This patch enables compilation of ML use cases bare-metal applications using Arm GNU Embedded Toolchain. The GNU toolchain can be used instead of the Arm Compiler that was already supported. The GNU toolchain is also set as the default toolchain when building applications for the MPS3 target. Note: The version of GNU toolchain must be 10.2.1 or higher. Change-Id: I5fff242f0f52d2db6c75d292f9fa990df1aec978 Signed-off-by: Kshitij Sisodia <kshitij.sisodia@arm.com>
Diffstat (limited to 'source/use_case/img_class')
-rw-r--r--source/use_case/img_class/src/UseCaseHandler.cc15
1 files changed, 9 insertions, 6 deletions
diff --git a/source/use_case/img_class/src/UseCaseHandler.cc b/source/use_case/img_class/src/UseCaseHandler.cc
index 22e6ba0..fa77512 100644
--- a/source/use_case/img_class/src/UseCaseHandler.cc
+++ b/source/use_case/img_class/src/UseCaseHandler.cc
@@ -22,6 +22,8 @@
#include "UseCaseCommonUtils.hpp"
#include "hal.h"
+#include <inttypes.h>
+
using ImgClassClassifier = arm::app::Classifier;
namespace arm {
@@ -142,7 +144,7 @@ namespace app {
dataPsnTxtInfStartX, dataPsnTxtInfStartY, 0);
/* Run inference over this image. */
- info("Running inference on image %u => %s\n", ctx.Get<uint32_t>("imgIndex"),
+ info("Running inference on image %" PRIu32 " => %s\n", ctx.Get<uint32_t>("imgIndex"),
get_filename(ctx.Get<uint32_t>("imgIndex")));
if (!RunInference(model, profiler)) {
@@ -185,13 +187,13 @@ namespace app {
inputTensor->bytes : IMAGE_DATA_SIZE;
const uint8_t* imgSrc = get_img_array(imIdx);
if (nullptr == imgSrc) {
- printf_err("Failed to get image index %u (max: %u)\n", imIdx,
+ printf_err("Failed to get image index %" PRIu32 " (max: %u)\n", imIdx,
NUMBER_OF_FILES - 1);
return false;
}
memcpy(inputTensor->data.data, imgSrc, copySz);
- debug("Image %u loaded\n", imIdx);
+ debug("Image %" PRIu32 " loaded\n", imIdx);
return true;
}
@@ -210,7 +212,7 @@ namespace app {
static bool SetAppCtxImageIdx(ApplicationContext& ctx, uint32_t idx)
{
if (idx >= NUMBER_OF_FILES) {
- printf_err("Invalid idx %u (expected less than %u)\n",
+ printf_err("Invalid idx %" PRIu32 " (expected less than %u)\n",
idx, NUMBER_OF_FILES);
return false;
}
@@ -254,8 +256,9 @@ namespace app {
dataPsnTxtStartX2, rowIdx2, 0);
rowIdx2 += dataPsnTxtYIncr;
- info("%u) %u (%f) -> %s\n", i, results[i].m_labelIdx,
- results[i].m_normalisedVal, results[i].m_label.c_str());
+ info("%" PRIu32 ") %" PRIu32 " (%f) -> %s\n", i,
+ results[i].m_labelIdx, results[i].m_normalisedVal,
+ results[i].m_label.c_str());
}
return true;