IVGCVSW-4915 Improving messages around SAMPLE_DYNAMIC_BACKEND_ENABLED
authorColm Donelan <Colm.Donelan@arm.com>
Wed, 3 Jun 2020 07:00:28 +0000 (08:00 +0100)
committerColm Donelan <colm.donelan@arm.com>
Wed, 3 Jun 2020 10:45:45 +0000 (10:45 +0000)
* If SAMPLE_DYNAMIC_BACKEND_ENABLED is enabled but DYNAMIC_BACKEND_PATHS
  is not set then the user gets failing tests cases with no clear idea
  what has gone wrong. Explicitly failing when DYNAMIC_BACKEND_PATHS has
  not been set.
* Adding an FAQ entry describing how the user can get confused by our
  documented usage of CMake.

Signed-off-by: Colm Donelan <Colm.Donelan@arm.com>
Change-Id: Ic11e14a971f53a6454962354ff728365ccc9de6d

cmake/GlobalConfig.cmake
docs/FAQ.md
src/backends/backendsCommon/test/DynamicBackendTests.hpp

index 6aa6321..650d409 100644 (file)
@@ -26,6 +26,7 @@ option(FLATC_DIR "Path to Flatbuffers compiler" OFF)
 option(TF_LITE_GENERATED_PATH "Tensorflow lite generated C++ schema location" OFF)
 option(FLATBUFFERS_ROOT "Location where the flatbuffers 'include' and 'lib' folders to be found" Off)
 option(DYNAMIC_BACKEND_PATHS "Colon seperated list of paths where to load the dynamic backends from" "")
+option(SAMPLE_DYNAMIC_BACKEND "Include the sample dynamic backend and its tests in the build" OFF)
 option(BUILD_GATORD_MOCK "Build the Gatord simulator for external profiling testing." ON)
 option(BUILD_TIMELINE_DECODER "Build the Timeline Decoder for external profiling." ON)
 option(SHARED_BOOST "Use dynamic linking for boost libraries" OFF)
index 1df82e8..918f4e1 100644 (file)
@@ -20,3 +20,8 @@ Segmentation fault following a failed call to armnn::Optimize using CpuRef backe
 In some error scenarios of calls to armnn::Optimize a null pointer may be returned. This contravenes the function documentation however, it can happen. Users are advised to check the value returned from the function as a precaution.
 
 If you encounter this problem and are able to isolate it consider contributing a solution.
+
+Adding or removing -Dxxx options when building ArmNN does not always work.
+---------------------------------------------------------
+
+ArmNN uses CMake for build configuration. CMake uses a cumulative cache of user options. That is, setting a value once on a cmake command line will be persisted until either you explicitly change the value or delete the cache. To delete the cache in ArmNN you must delete the build directory.
index 6371e53..16c2f0d 100644 (file)
@@ -1439,11 +1439,15 @@ void CreateReferenceDynamicBackendTestImpl()
 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);
+    // If m_DynamicBackendsPath is an empty string then we know this test will fail.
+    if(creationOptions.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(creationOptions);
     const BackendRegistry& backendRegistry = BackendRegistryInstance();
     BOOST_TEST(backendRegistry.Size() >= 1);
 
@@ -1506,6 +1510,12 @@ 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));
 
     // Builds up the structure of the network.