Skip to content

Commit 8223622

Browse files
committed
Arm backend: Print output to log when using BundleIO
This make it possible to build with extra input/output logging Signed-off-by: Zingo Andersen <zingo.andersen@arm.com> Change-Id: Iebffbbbfbc31e48e7496379e88d9ce6307f144b9
1 parent a2b620a commit 8223622

3 files changed

Lines changed: 14 additions & 9 deletions

File tree

backends/arm/test/test_model.py

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def get_args():
6464
parser.add_argument(
6565
"--timeout",
6666
required=False,
67-
default=60 * 10,
67+
default=60 * 20,
6868
help="Timeout in seconds used when running the model",
6969
)
7070
args = parser.parse_args()
@@ -165,11 +165,6 @@ def build_ethosu_runtime(
165165
extra_flags: str,
166166
elf_build_path: str,
167167
):
168-
169-
extra_build_flag = ""
170-
if extra_flags:
171-
extra_build_flag = f"--extra_build_flags={extra_flags}"
172-
173168
run_external_cmd(
174169
[
175170
"bash",
@@ -182,7 +177,7 @@ def build_ethosu_runtime(
182177
"--build_type=Release",
183178
f"--system_config={system_config}",
184179
f"--memory_mode={memory_mode}",
185-
extra_build_flag,
180+
f"--extra_build_flags=-DET_DUMP_OUTPUT=OFF {extra_flags}",
186181
f"--output={elf_build_path}",
187182
]
188183
)

examples/arm/executor_runner/CMakeLists.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ option(ET_ARM_BAREMETAL_METHOD_ALLOCATOR_POOL_SIZE "Set ET_ARM_BAREMETAL_METHOD_
1111
option(ET_BUNDLE_IO "Set to compile in BundleIO support" OFF)
1212
option(ET_ATOL "Set atol to use for BundleIO testing" OFF)
1313
option(ET_RTOL "Set rtol to use for BundleIO testing" OFF)
14+
option(ET_DUMP_INPUT "Dump input in log" OFF)
15+
option(ET_DUMP_OUTPUT "Dump output in log" ON)
1416
option(FETCH_ETHOS_U_CONTENT "Fetch ethos_u dependencies instead of relying on pre-downloads" ON)
1517

1618
if(NOT DEFINED ET_PTE_FILE_PATH AND NOT ${SEMIHOSTING})
@@ -664,6 +666,14 @@ if(ET_RTOL)
664666
target_compile_definitions(arm_executor_runner PUBLIC ET_RTOL=${ET_RTOL})
665667
endif()
666668

669+
if(ET_DUMP_INPUT)
670+
target_compile_definitions(arm_executor_runner PUBLIC -DET_DUMP_INPUT)
671+
endif()
672+
673+
if(ET_DUMP_OUTPUT)
674+
target_compile_definitions(arm_executor_runner PUBLIC -DET_DUMP_OUTPUT)
675+
endif()
676+
667677
# Fixup compilation of retarget.c
668678
if(SEMIHOSTING)
669679
# Remove this when MLBEDSW-8910 is closed.

examples/arm/executor_runner/arm_executor_runner.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -641,7 +641,7 @@ int main(int argc, const char* argv[]) {
641641
prepared_inputs.error());
642642
}
643643
}
644-
#ifdef DUMP_INPUT
644+
#if defined(ET_DUMP_INPUT)
645645
{
646646
std::vector<EValue> inputs(method->inputs_size());
647647
ET_LOG(Info, "%zu inputs: ", inputs.size());
@@ -756,7 +756,7 @@ int main(int argc, const char* argv[]) {
756756
for (int i = 0; i < outputs.size(); ++i) {
757757
Tensor t = outputs[i].toTensor();
758758
#if !defined(SEMIHOSTING)
759-
#if !defined(ET_BUNDLE_IO)
759+
#if defined(ET_DUMP_OUTPUT)
760760
// The output might be collected and parsed so printf() is used instead
761761
// of ET_LOG() here
762762
for (int j = 0; j < outputs[i].toTensor().numel(); ++j) {

0 commit comments

Comments
 (0)