summaryrefslogtreecommitdiff
path: root/source/application/tensorflow-lite-micro
diff options
context:
space:
mode:
authoralexander <alexander.efremov@arm.com>2022-02-10 16:15:54 +0000
committeralexander <alexander.efremov@arm.com>2022-02-10 18:04:42 +0000
commit31ae9f09bb3535975595e999fbc7baca889e46e8 (patch)
tree71f0cadc2620b9d18e474e5d40eda7b3d30a8ce4 /source/application/tensorflow-lite-micro
parent3107aa2152de9be8317e62da1d0327bcad6552e2 (diff)
downloadml-embedded-evaluation-kit-31ae9f09bb3535975595e999fbc7baca889e46e8.tar.gz
MLECO-2682: CMake and source refactoring.
MLECO-2930: logging macros were extracted from hal.h and used separately around the code. MLECO-2931: arm_math lib introduced, cmsis-dsp removed from top level linkage. MLECO-2915: platform related post-build steps. Change-Id: Id718884e22f262a5c070ded3f3f5d4b048820147 Signed-off-by: alexander <alexander.efremov@arm.com>
Diffstat (limited to 'source/application/tensorflow-lite-micro')
-rw-r--r--source/application/tensorflow-lite-micro/Model.cc21
-rw-r--r--source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc2
2 files changed, 6 insertions, 17 deletions
diff --git a/source/application/tensorflow-lite-micro/Model.cc b/source/application/tensorflow-lite-micro/Model.cc
index acc2f0e..adcf8d7 100644
--- a/source/application/tensorflow-lite-micro/Model.cc
+++ b/source/application/tensorflow-lite-micro/Model.cc
@@ -15,19 +15,14 @@
* limitations under the License.
*/
#include "Model.hpp"
+#include "log_macros.h"
-#include "hal.h"
-
-#include <cstdint>
-#include <inttypes.h>
+#include <cinttypes>
/* Initialise the model */
arm::app::Model::~Model()
{
- if (this->m_pInterpreter) {
- delete this->m_pInterpreter;
- }
-
+ delete this->m_pInterpreter;
/**
* No clean-up function available for allocator in TensorFlow Lite Micro yet.
**/
@@ -222,7 +217,7 @@ void arm::app::Model::LogInterpreterInfo()
tflite::GetRegistrationFromOpCode(opcode, this->GetOpResolver(),
this->m_pErrorReporter, &reg);
- std::string opName{""};
+ std::string opName;
if (reg) {
if (tflite::BuiltinOperator_CUSTOM == reg->builtin_code) {
@@ -262,7 +257,7 @@ bool arm::app::Model::ContainsEthosUOperator() const
auto builtin_code = tflite::GetBuiltinCode(opcode);
if ((builtin_code == tflite::BuiltinOperator_CUSTOM) &&
( nullptr != opcode->custom_code()) &&
- ( 0 == std::string(opcode->custom_code()->c_str()).compare("ethos-u")))
+ ( "ethos-u" == std::string(opcode->custom_code()->c_str())))
{
return true;
}
@@ -350,11 +345,7 @@ bool arm::app::Model::ShowModelInfoHandler()
info("Model info:\n");
this->LogInterpreterInfo();
-#if defined(ARM_NPU)
- info("Use of Arm uNPU is enabled\n");
-#else /* ARM_NPU */
- info("Use of Arm uNPU is disabled\n");
-#endif /* ARM_NPU */
+ info("The model is optimised for Ethos-U NPU: %s.\n", this->ContainsEthosUOperator()? "yes": "no");
return true;
}
diff --git a/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc b/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc
index 0b08513..e82e9b5 100644
--- a/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc
+++ b/source/application/tensorflow-lite-micro/TensorFlowLiteMicro.cc
@@ -16,8 +16,6 @@
*/
#include "TensorFlowLiteMicro.hpp"
-#include "hal.h"
-
void PrintTensorFlowVersion()
{}