summaryrefslogtreecommitdiff
path: root/source/application/main
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/application/main
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/application/main')
-rw-r--r--source/application/main/Classifier.cc3
-rw-r--r--source/application/main/Mfcc.cc15
-rw-r--r--source/application/main/Profiler.cc5
-rw-r--r--source/application/main/UseCaseCommonUtils.cc4
4 files changed, 16 insertions, 11 deletions
diff --git a/source/application/main/Classifier.cc b/source/application/main/Classifier.cc
index 9a47f3d..c5519fb 100644
--- a/source/application/main/Classifier.cc
+++ b/source/application/main/Classifier.cc
@@ -23,6 +23,7 @@
#include <string>
#include <set>
#include <cstdint>
+#include <inttypes.h>
namespace arm {
namespace app {
@@ -125,7 +126,7 @@ namespace app {
/* Sanity checks. */
if (totalOutputSize < topNCount) {
- printf_err("Output vector is smaller than %u\n", topNCount);
+ printf_err("Output vector is smaller than %" PRIu32 "\n", topNCount);
return false;
} else if (totalOutputSize != labels.size()) {
printf_err("Output size doesn't match the labels' size\n");
diff --git a/source/application/main/Mfcc.cc b/source/application/main/Mfcc.cc
index 9ddcb5d..c8ad138 100644
--- a/source/application/main/Mfcc.cc
+++ b/source/application/main/Mfcc.cc
@@ -19,6 +19,7 @@
#include "PlatformMath.hpp"
#include <cfloat>
+#include <inttypes.h>
namespace arm {
namespace app {
@@ -49,16 +50,16 @@ namespace audio {
char strC[1024];
snprintf(strC, sizeof(strC) - 1, "\n \
\n\t Sampling frequency: %f\
- \n\t Number of filter banks: %u\
+ \n\t Number of filter banks: %" PRIu32 "\
\n\t Mel frequency limit (low): %f\
\n\t Mel frequency limit (high): %f\
- \n\t Number of MFCC features: %u\
- \n\t Frame length: %u\
- \n\t Padded frame length: %u\
+ \n\t Number of MFCC features: %" PRIu32 "\
+ \n\t Frame length: %" PRIu32 "\
+ \n\t Padded frame length: %" PRIu32 "\
\n\t Using HTK for Mel scale: %s\n",
- this->m_samplingFreq, this->m_numFbankBins, this->m_melLoFreq,
- this->m_melHiFreq, this->m_numMfccFeatures, this->m_frameLen,
- this->m_frameLenPadded, this->m_useHtkMethod ? "yes" : "no");
+ this->m_samplingFreq, this->m_numFbankBins, this->m_melLoFreq,
+ this->m_melHiFreq, this->m_numMfccFeatures, this->m_frameLen,
+ this->m_frameLenPadded, this->m_useHtkMethod ? "yes" : "no");
return std::string{strC};
}
diff --git a/source/application/main/Profiler.cc b/source/application/main/Profiler.cc
index 10a828a..5924414 100644
--- a/source/application/main/Profiler.cc
+++ b/source/application/main/Profiler.cc
@@ -208,7 +208,7 @@ namespace app {
}
void printStatisticsHeader(uint32_t samplesNum) {
- info("Number of samples: %i\n", samplesNum);
+ info("Number of samples: %" PRIu32 "\n", samplesNum);
info("%s\n", "Total / Avg./ Min / Max");
}
@@ -224,7 +224,8 @@ namespace app {
for (Statistics &stat: result.data) {
if (printFullStat) {
- info("%s %s: %llu / %.0f / %llu / %llu \n", stat.name.c_str(), stat.unit.c_str(),
+ info("%s %s: %" PRIu64 "/ %.0f / %" PRIu64 " / %" PRIu64 " \n",
+ stat.name.c_str(), stat.unit.c_str(),
stat.total, stat.avrg, stat.min, stat.max);
} else {
info("%s %s: %.0f\n", stat.name.c_str(), stat.unit.c_str(), stat.avrg);
diff --git a/source/application/main/UseCaseCommonUtils.cc b/source/application/main/UseCaseCommonUtils.cc
index 3acf53f..b3653d9 100644
--- a/source/application/main/UseCaseCommonUtils.cc
+++ b/source/application/main/UseCaseCommonUtils.cc
@@ -18,6 +18,8 @@
#include "InputFiles.hpp"
+#include <inttypes.h>
+
namespace arm {
namespace app {
@@ -103,7 +105,7 @@ namespace app {
currentFilename.size(),
dataPsnTxtStartX, yVal, 0);
- info("\t%u => %s\n", i, currentFilename.c_str());
+ info("\t%" PRIu32 " => %s\n", i, currentFilename.c_str());
}
#endif /* NUMBER_OF_FILES > 0 */