diff options
-rw-r--r-- | tests/ExecuteNetwork/ArmNNExecutor.cpp | 10 | ||||
-rw-r--r-- | tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp | 4 |
2 files changed, 10 insertions, 4 deletions
diff --git a/tests/ExecuteNetwork/ArmNNExecutor.cpp b/tests/ExecuteNetwork/ArmNNExecutor.cpp index 2bbb9f9a8d..23f5f8ee25 100644 --- a/tests/ExecuteNetwork/ArmNNExecutor.cpp +++ b/tests/ExecuteNetwork/ArmNNExecutor.cpp @@ -9,11 +9,13 @@ #include <AsyncExecutionCallback.hpp> #include <armnn/IAsyncExecutionCallback.hpp> +#if defined(ARMNN_SERIALIZER) #include <armnnSerializer/ISerializer.hpp> - +#endif using namespace armnn; using namespace std::chrono; +#if defined(ARMNN_SERIALIZER) /** * Given a reference to an INetwork and a target directory, serialize the network to a file * called "<timestamp>_network.armnn" @@ -121,6 +123,7 @@ std::string SerializeNetworkToDotFile(const armnn::IOptimizedNetwork& optimizedN fileStream.close(); return fileName; } +#endif ArmNNExecutor::ArmNNExecutor(const ExecuteNetworkParams& params, armnn::IRuntime::CreationOptions runtimeOptions) : m_Params(params) @@ -139,6 +142,7 @@ ArmNNExecutor::ArmNNExecutor(const ExecuteNetworkParams& params, armnn::IRuntime // If the user has asked for detailed data write out the .armnn amd .dot files. if (params.m_SerializeToArmNN) { +#if defined(ARMNN_SERIALIZER) // .armnn first. // This could throw multiple exceptions if the directory cannot be created or the file cannot be written. std::string targetDirectory(armnnUtils::Filesystem::CreateDirectory("/ArmNNSerializeNetwork")); @@ -150,8 +154,10 @@ ArmNNExecutor::ArmNNExecutor(const ExecuteNetworkParams& params, armnn::IRuntime fileName = SerializeNetworkToDotFile(*optNet, targetDirectory); ARMNN_LOG(info) << "The optimized network has been serialized to:" << fileName; +#else + ARMNN_LOG(info) << "Arm NN has not been built with ARMNN_SERIALIZER enabled."; +#endif } - m_IOInfo = GetIOInfo(optNet.get()); armnn::ProfilingDetailsMethod profilingDetailsMethod = ProfilingDetailsMethod::Undefined; diff --git a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp index ba994b0da8..2eb68713c6 100644 --- a/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp +++ b/tests/ExecuteNetwork/ExecuteNetworkProgramOptions.cpp @@ -352,10 +352,10 @@ ProgramOptions::ProgramOptions() : m_CxxOptions{"ExecuteNetwork", " the tflite ref model.", cxxopts::value<bool>(m_ExNetParams.m_CompareWithTflite)->default_value("false") ->implicit_value("true")) - ("serialize-to-armnn", "Serialize the loaded network to an .armnn file. This option will also serialize the optimized network" - " in dot format. This option only works with the TfLite parser. An inference will NOT be executed.", + " in dot format. This option only works with both the TfLite parser and the Arm NN serializer" + " enabled in the build. An inference will NOT be executed.", cxxopts::value<bool>(m_ExNetParams.m_SerializeToArmNN)->default_value("false") ->implicit_value("true")); |