diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2021-10-04 22:55:37 +0100 |
---|---|---|
committer | Colm Donelan <colm.donelan@arm.com> | 2021-10-11 13:55:19 +0000 |
commit | 3e32a8700bf12d3b70d2824c12cdae907bde9360 (patch) | |
tree | 9b2ff65b2ccf4f14ee526b4e8e13bbf4e6f07c1b /delegate/src/test/DelegateOptionsTest.cpp | |
parent | 1112b016e7ffad979b7bd0c8d54c9c679d4043e2 (diff) | |
download | armnn-3e32a8700bf12d3b70d2824c12cdae907bde9360.tar.gz |
IVGCVSW-5752 Add missing runtime parameters to TfLite delegate.
* Adding Runtime parameter: dynamic-backends-path
* Add profiling parameters:
gpu-enable-profiling,
enable-internal-profiling, internal-profiling-detail,
enable-external-profiling, timeline-profiling, outgoing-capture-file,
incoming-capture-file, file-only-external-profiling,
counter-capture-period, profiling-file-format
* Adding utility parameter "serialize-to-dot"
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: Ibff4b9a85ff0f0da5d70e8aa0bb6cba96aaabbc3
Diffstat (limited to 'delegate/src/test/DelegateOptionsTest.cpp')
-rw-r--r-- | delegate/src/test/DelegateOptionsTest.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/delegate/src/test/DelegateOptionsTest.cpp b/delegate/src/test/DelegateOptionsTest.cpp index c7231fb279..338772596b 100644 --- a/delegate/src/test/DelegateOptionsTest.cpp +++ b/delegate/src/test/DelegateOptionsTest.cpp @@ -5,6 +5,7 @@ #include "DelegateOptionsTestHelper.hpp" #include <common/include/ProfilingGuid.hpp> +#include <armnnUtils/Filesystem.hpp> namespace armnnDelegate { @@ -185,6 +186,44 @@ TEST_CASE ("ArmnnDelegateModelOptions_CpuAcc_Test") delegateOptions); } +TEST_CASE ("ArmnnDelegateSerializeToDot") +{ + const fs::path filename(fs::temp_directory_path() / "ArmnnDelegateSerializeToDot.dot"); + if ( fs::exists(filename) ) + { + fs::remove(filename); + } + std::stringstream ss; + { + StreamRedirector redirect(std::cout, ss.rdbuf()); + + std::vector<armnn::BackendId> backends = { armnn::Compute::CpuRef }; + std::vector<int32_t> tensorShape { 1, 2, 2, 1 }; + std::vector<float> inputData = { 1, 2, 3, 4 }; + std::vector<float> divData = { 2, 2, 3, 4 }; + std::vector<float> expectedResult = { 1, 2, 2, 2 }; + + armnn::OptimizerOptions optimizerOptions(false, false, false, false); + armnnDelegate::DelegateOptions delegateOptions(backends, optimizerOptions); + // Enable serialize to dot by specifying the target file name. + delegateOptions.SetSerializeToDot(filename); + DelegateOptionTest<float>(::tflite::TensorType_FLOAT32, + backends, + tensorShape, + inputData, + inputData, + divData, + expectedResult, + delegateOptions); + } + CHECK(fs::exists(filename)); + // The file should have a size greater than 0 bytes. + CHECK(fs::file_size(filename) > 0); + // Clean up. + fs::remove(filename); +} + + } } // namespace armnnDelegate |