diff --git a/platform/linux-generic/test/performance/Makefile.am b/platform/linux-generic/test/performance/Makefile.am index 4070f09f2e..2a05607015 100644 --- a/platform/linux-generic/test/performance/Makefile.am +++ b/platform/linux-generic/test/performance/Makefile.am @@ -1 +1,27 @@ SUBDIRS = dmafwd + +if WITH_ML +TESTS = odp_ml_perf_run.sh +EXTRA_DIST = odp_ml_perf_run.sh +endif + +# If building out-of-tree, make check will not copy the scripts and data to the +# $(builddir) assuming that all commands are run locally. However this prevents +# running tests on a remote target using LOG_COMPILER. +# So copy all script and data files explicitly here. +all-local: + if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + for f in $(EXTRA_DIST); do \ + if [ -e $(srcdir)/$$f ]; then \ + mkdir -p $(builddir)/$$(dirname $$f); \ + cp -f $(srcdir)/$$f $(builddir)/$$f; \ + fi \ + done \ + fi + +clean-local: + if [ "x$(srcdir)" != "x$(builddir)" ]; then \ + for f in $(EXTRA_DIST); do \ + rm -f $(builddir)/$$f; \ + done \ + fi diff --git a/platform/linux-generic/test/performance/odp_ml_perf_run.sh b/platform/linux-generic/test/performance/odp_ml_perf_run.sh new file mode 100755 index 0000000000..8ddd086866 --- /dev/null +++ b/platform/linux-generic/test/performance/odp_ml_perf_run.sh @@ -0,0 +1,20 @@ +#!/bin/sh -xe +# +# SPDX-License-Identifier: BSD-3-Clause +# Copyright (c) 2024 Nokia + +TEST_DIR="${TEST_DIR:-$(dirname $0)}" + +cd $TEST_DIR +BIN_DIR=../../../../test/performance +MODEL_DIR=../../example/ml + +run_conv() { + $BIN_DIR/odp_ml_perf${EXEEXT} -M $MODEL_DIR/conv.onnx \ + -I $MODEL_DIR/conv-input.bin -R $MODEL_DIR/conv-output.bin $@ +} + +run_conv -m 0 -r 1000 +run_conv -m 0 -r 1000 -l +run_conv -m 2 -l +run_conv -m 3 -l