diff options
author | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2021-09-24 14:42:08 +0100 |
---|---|---|
committer | Kshitij Sisodia <kshitij.sisodia@arm.com> | 2021-09-24 13:43:22 +0000 |
commit | aa5e1f6c960b8a88f389ba70dd200d6dacd95a03 (patch) | |
tree | f05ad3ee9f6eff64a41464f32387d4150fe9363a /source/application/main | |
parent | 864317690dd670a18194e2a95c7c0da573613fa1 (diff) | |
download | ml-embedded-evaluation-kit-aa5e1f6c960b8a88f389ba70dd200d6dacd95a03.tar.gz |
MLECO-2345: Adding dynamic load support for FVPs
With this patch, the generic inference runner use-case can be
configured to accept the model tflite file at run-time via
the FVP's command line parameters. Same is true for the IFM
and the inference results can be dumped out too.
NOTE: this change is only for supporting the FVP, the FPGA
implementation will not allow additional loading for the
changes in this patch to be useful.
Change-Id: I1318bd5b0cfb7bb635ced6fe58d22c3e401d2547
Diffstat (limited to 'source/application/main')
-rw-r--r-- | source/application/main/UseCaseCommonUtils.cc | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/source/application/main/UseCaseCommonUtils.cc b/source/application/main/UseCaseCommonUtils.cc index 9834475..a99e05d 100644 --- a/source/application/main/UseCaseCommonUtils.cc +++ b/source/application/main/UseCaseCommonUtils.cc @@ -136,6 +136,7 @@ bool image::PresentInferenceResult(hal_platform &platform, void IncrementAppCtxIfmIdx(arm::app::ApplicationContext& ctx, std::string useCase) { +#if NUMBER_OF_FILES > 0 auto curImIdx = ctx.Get<uint32_t>(useCase); if (curImIdx + 1 >= NUMBER_OF_FILES) { @@ -144,10 +145,15 @@ void IncrementAppCtxIfmIdx(arm::app::ApplicationContext& ctx, std::string useCas } ++curImIdx; ctx.Set<uint32_t>(useCase, curImIdx); +#else /* NUMBER_OF_FILES > 0 */ + UNUSED(ctx); + UNUSED(useCase); +#endif /* NUMBER_OF_FILES > 0 */ } bool SetAppCtxIfmIdx(arm::app::ApplicationContext& ctx, uint32_t idx, std::string ctxIfmName) { +#if NUMBER_OF_FILES > 0 if (idx >= NUMBER_OF_FILES) { printf_err("Invalid idx %" PRIu32 " (expected less than %u)\n", idx, NUMBER_OF_FILES); @@ -155,9 +161,14 @@ bool SetAppCtxIfmIdx(arm::app::ApplicationContext& ctx, uint32_t idx, std::strin } ctx.Set<uint32_t>(ctxIfmName, idx); return true; +#else /* NUMBER_OF_FILES > 0 */ + UNUSED(ctx); + UNUSED(idx); + UNUSED(ctxIfmName); + return false; +#endif /* NUMBER_OF_FILES > 0 */ } - namespace arm { namespace app { |