aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTeresa Charlin <teresa.charlinreyes@arm.com>2023-02-21 15:16:09 +0000
committerTeresaARM <teresa.charlinreyes@arm.com>2023-02-21 17:26:02 +0000
commitdf15c4e8a03423188d0598dc1a503c2d7a6d9f4e (patch)
treeb48f8ede0dfabf16817a8519aae2ed880e7f6ca5
parenta544f0f5d01ea980ca86e1e13e2530fea4fddcd2 (diff)
downloadarmnn-df15c4e8a03423188d0598dc1a503c2d7a6d9f4e.tar.gz
Report errors when running LoadedNetwork in End to End tests
Signed-off-by: Teresa Charlin <teresa.charlinreyes@arm.com> Change-Id: I8d65673580924907db51d903d9054d1b0914493c
-rw-r--r--src/backends/backendsCommon/test/EndToEndTestImpl.hpp91
1 files changed, 49 insertions, 42 deletions
diff --git a/src/backends/backendsCommon/test/EndToEndTestImpl.hpp b/src/backends/backendsCommon/test/EndToEndTestImpl.hpp
index 44ae2beb76..795fc13c32 100644
--- a/src/backends/backendsCommon/test/EndToEndTestImpl.hpp
+++ b/src/backends/backendsCommon/test/EndToEndTestImpl.hpp
@@ -1,5 +1,5 @@
//
-// Copyright © 2017 Arm Ltd. All rights reserved.
+// Copyright © 2017-2023 Arm Ltd and Contributors. All rights reserved.
// SPDX-License-Identifier: MIT
//
#pragma once
@@ -56,7 +56,9 @@ bool ConstantUsageTest(const std::vector<BackendId>& computeDevice,
// Loads it into the runtime.
NetworkId netId;
- runtime->LoadNetwork(netId, std::move(optNet));
+ std::string errorMessage;
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
// Creates structures for input & output.
std::vector<T> outputData(inputData.size());
@@ -141,7 +143,9 @@ void EndToEndLayerTestImpl(INetworkPtr network,
// Loads it into the runtime.
NetworkId netId;
- runtime->LoadNetwork(netId, std::move(optNet));
+ std::string errorMessage;
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
InputTensors inputTensors;
inputTensors.reserve(inputTensorData.size());
@@ -211,10 +215,11 @@ inline void ImportNonAlignedInputPointerTest(std::vector<BackendId> backends)
// Loads it into the runtime.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
// Enable Importing
INetworkProperties networkProperties(false, MemorySource::Malloc, MemorySource::Undefined);
- runtime->LoadNetwork(netId, std::move(optNet), ignoredErrorMessage, networkProperties);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
// Creates structures for input & output
std::vector<float> inputData
@@ -279,10 +284,11 @@ inline void ExportNonAlignedOutputPointerTest(std::vector<BackendId> backends)
// Loads it into the runtime.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
// Enable Importing and Exporting
INetworkProperties networkProperties(false, MemorySource::Malloc, MemorySource::Malloc);
- runtime->LoadNetwork(netId, std::move(optNet), ignoredErrorMessage, networkProperties);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
// Creates structures for input & output
std::vector<float> inputData
@@ -353,10 +359,11 @@ inline void ImportAlignedPointerTest(std::vector<BackendId> backends)
// Loads it into the runtime.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
// Enable Importing
INetworkProperties networkProperties(false, MemorySource::Malloc, MemorySource::Malloc);
- runtime->LoadNetwork(netId, std::move(optNet), ignoredErrorMessage, networkProperties);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
// Creates structures for input & output
std::vector<float> inputData
@@ -439,12 +446,10 @@ inline void ImportOnlyWorkload(std::vector<BackendId> backends)
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
-
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Malloc, MemorySource::Undefined);
-
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
INFO("Generate Data");
// Creates structures for input & output
@@ -531,10 +536,10 @@ inline void ExportOnlyWorkload(std::vector<BackendId> backends)
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Undefined, MemorySource::Malloc);
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
INFO("Generate Data");
// Creates structures for input & output
@@ -621,12 +626,10 @@ inline void ImportAndExportWorkload(std::vector<BackendId> backends)
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
-
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Malloc, MemorySource::Malloc);
-
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
INFO("Generate Data");
// Creates structures for input & output
@@ -716,10 +719,11 @@ inline void ExportOutputWithSeveralOutputSlotConnectionsTest(std::vector<Backend
// Loads it into the runtime.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
// Enable Importing
INetworkProperties networkProperties(false, MemorySource::Malloc, MemorySource::Malloc);
- runtime->LoadNetwork(netId, std::move(optNet), ignoredErrorMessage, networkProperties);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
// Creates structures for input & output
std::vector<float> inputData
@@ -852,10 +856,11 @@ inline void ForceImportWithAlignedBuffersEndToEndTest(std::vector<BackendId> bac
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Undefined, MemorySource::Undefined);
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
+
INFO("Generate Data");
// Creates structures for input & output
@@ -955,10 +960,11 @@ inline void ForceImportWithMisalignedInputBuffersEndToEndTest(std::vector<Backen
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Undefined, MemorySource::Undefined);
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
+
INFO("Generate Data");
// This code looks a little funky but the idea is to create a buffer of floats but offset by the size of a char
@@ -1077,10 +1083,11 @@ inline void ForceImportWithMisalignedOutputBuffersEndToEndTest(std::vector<Backe
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Undefined, MemorySource::Undefined);
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
+
INFO("Generate Data");
// This code looks a little funky but the idea is to create a buffer of floats but offset by the size of a char
@@ -1198,10 +1205,10 @@ inline void ForceImportWithMisalignedInputAndOutputBuffersEndToEndTest(std::vect
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Undefined, MemorySource::Undefined);
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
INFO("Generate Data");
// This code looks a little funky but the idea is to create a buffer of floats but offset by the size of a char
@@ -1316,10 +1323,10 @@ inline void ForceImportRepeatedInferencesEndToEndTest(std::vector<BackendId> bac
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Undefined, MemorySource::Undefined);
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
INFO("Generate Data");
// Creates structures for input & output
@@ -1502,10 +1509,10 @@ inline void ForceImportRepeatedInferencesInvertedEndToEndTest(std::vector<Backen
INFO("Load Network");
// Load it into the runtime. It should pass.
NetworkId netId;
- std::string ignoredErrorMessage;
+ std::string errorMessage;
INetworkProperties networkProperties(false, MemorySource::Undefined, MemorySource::Undefined);
- CHECK(runtime->LoadNetwork(netId, std::move(optNet),ignoredErrorMessage, networkProperties)
- == Status::Success);
+ armnn::Status loadingStatus = runtime->LoadNetwork(netId, std::move(optNet), errorMessage, networkProperties);
+ CHECK_MESSAGE(loadingStatus == Status::Success, errorMessage);
INFO("Generate Data");
// This code looks a little funky but the idea is to create a buffer of floats but offset by the size of a char