Github #273 Handle failure to initialise BackendContext in Runtime

Define CreateBackendContext to throw BackendUnavailableException
if necessary runtime components are missing.

Handle this in the constructor of Runtime by not adding those
backends to the internal DeviceSpec owned by the Runtime.

Signed-off-by: Matthew Bentham <Matthew.Bentham@arm.com>
Change-Id: Iadffb5240e32e1f105683c4d361276b92d1e720c
diff --git a/include/armnn/backends/IBackendInternal.hpp b/include/armnn/backends/IBackendInternal.hpp
index 29097b4..6c919ee 100644
--- a/include/armnn/backends/IBackendInternal.hpp
+++ b/include/armnn/backends/IBackendInternal.hpp
@@ -115,9 +115,16 @@
     virtual IWorkloadFactoryPtr CreateWorkloadFactory(
         class TensorHandleFactoryRegistry& tensorHandleFactoryRegistry) const;
 
+    /// Create the runtime context of the backend
+    ///
+    /// Implementations may return a default-constructed IBackendContextPtr if
+    /// no context is needed at runtime.
+    /// Implementations must throw BackendUnavailableException if the backend
+    /// cannot be used (for example, necessary accelerator hardware is not present).
+    /// The default implementation always returns a default-constructed pointer.
     virtual IBackendContextPtr CreateBackendContext(const IRuntime::CreationOptions&) const;
 
-    // Context specifically used for profiling interaction from backends.
+    /// Create context specifically used for profiling interaction from backends.
     virtual IBackendProfilingContextPtr CreateBackendProfilingContext(const IRuntime::CreationOptions& creationOptions,
         armnn::profiling::IBackendProfiling& backendProfiling) const;