diff options
author | Colm Donelan <Colm.Donelan@arm.com> | 2020-06-04 12:30:16 +0100 |
---|---|---|
committer | Colm Donelan <Colm.Donelan@arm.com> | 2020-06-04 12:30:16 +0100 |
commit | fa0d838fd7be90b6e1d53aa62da14ccc0cf0eacc (patch) | |
tree | 86828492c6dc8048bc2b568c690958dcc6db4c52 /src/backends/backendsCommon/test/DynamicBackendTests.hpp | |
parent | 1c6e9763aaac923660b795a55544b50f4b179d77 (diff) | |
download | armnn-fa0d838fd7be90b6e1d53aa62da14ccc0cf0eacc.tar.gz |
IVGCVSW-4923 Fix SampleDynamicBackendTests.
* Remove the check introduced by IVGCVSW-4915.
* Check that SampleDynamic is loaded. If not output a detailed message.
Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: Ib19b238418ea2d9c133e12bd540653ff0969ec5d
Diffstat (limited to 'src/backends/backendsCommon/test/DynamicBackendTests.hpp')
-rw-r--r-- | src/backends/backendsCommon/test/DynamicBackendTests.hpp | 36 |
1 files changed, 19 insertions, 17 deletions
diff --git a/src/backends/backendsCommon/test/DynamicBackendTests.hpp b/src/backends/backendsCommon/test/DynamicBackendTests.hpp index 16c2f0db7a..0c24ec6f44 100644 --- a/src/backends/backendsCommon/test/DynamicBackendTests.hpp +++ b/src/backends/backendsCommon/test/DynamicBackendTests.hpp @@ -1436,24 +1436,32 @@ void CreateReferenceDynamicBackendTestImpl() #endif #if defined(SAMPLE_DYNAMIC_BACKEND_ENABLED) -void CreateSampleDynamicBackendTestImpl() + +void CheckSampleDynamicBackendLoaded() { using namespace armnn; - // Using the path override in CreationOptions to load the reference dynamic backend - IRuntime::CreationOptions creationOptions; - // If m_DynamicBackendsPath is an empty string then we know this test will fail. - if(creationOptions.m_DynamicBackendsPath.empty()) + // At this point we expect DYNAMIC_BACKEND_PATHS to include a path to where libArm_SampleDynamic_backend.so is. + // If it hasn't been loaded there's no point continuing with the rest of the tests. + BackendIdSet backendIds = BackendRegistryInstance().GetBackendIds(); + if (backendIds.find("SampleDynamic") == backendIds.end()) { - BOOST_FAIL("No dynamic backends paths have been set. Ensure DYNAMIC_BACKEND_PATHS is set at compile time."); + std::string message = "The SampleDynamic backend has not been loaded. This may be a build configuration error. " + "Ensure a DYNAMIC_BACKEND_PATHS was set at compile time to the location of " + "libArm_SampleDynamic_backend.so. " + "To disable this test recompile with: -DSAMPLE_DYNAMIC_BACKEND_ENABLED=0"; + BOOST_FAIL(message); } +} +void CreateSampleDynamicBackendTestImpl() +{ + using namespace armnn; + // Using the path override in CreationOptions to load the reference dynamic backend + IRuntime::CreationOptions creationOptions; IRuntimePtr runtime = IRuntime::Create(creationOptions); const BackendRegistry& backendRegistry = BackendRegistryInstance(); BOOST_TEST(backendRegistry.Size() >= 1); - - BackendIdSet backendIds = backendRegistry.GetBackendIds(); - BOOST_TEST((backendIds.find("SampleDynamic") != backendIds.end())); - + CheckSampleDynamicBackendLoaded(); const DeviceSpec& deviceSpec = *PolymorphicDowncast<const DeviceSpec*>(&runtime->GetDeviceSpec()); BackendIdSet supportedBackendIds = deviceSpec.GetSupportedBackends(); BOOST_TEST(supportedBackendIds.size()>= 1); @@ -1510,14 +1518,8 @@ void SampleDynamicBackendEndToEndTestImpl() using namespace boost::filesystem; // Create runtime in which test will run IRuntime::CreationOptions options; - // If m_DynamicBackendsPath is an empty string then we know this test will fail. - if(options.m_DynamicBackendsPath.empty()) - { - BOOST_FAIL("No dynamic backends paths have been set. Ensure DYNAMIC_BACKEND_PATHS is set at compile time."); - } - IRuntimePtr runtime(IRuntime::Create(options)); - + CheckSampleDynamicBackendLoaded(); // Builds up the structure of the network. INetworkPtr net(INetwork::Create()); |