From 9a61fa6bdc8724cc66eba532360e0e48b6b1a60e Mon Sep 17 00:00:00 2001 From: Matthew Bentham Date: Tue, 4 Feb 2020 10:03:55 +0000 Subject: 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 Change-Id: Iadffb5240e32e1f105683c4d361276b92d1e720c --- include/armnn/Exceptions.hpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include/armnn/Exceptions.hpp') diff --git a/include/armnn/Exceptions.hpp b/include/armnn/Exceptions.hpp index e21e974fc7..066f59f792 100644 --- a/include/armnn/Exceptions.hpp +++ b/include/armnn/Exceptions.hpp @@ -64,12 +64,19 @@ private: std::string m_Message; }; -class ClRuntimeUnavailableException : public Exception +/// Class for non-fatal exceptions raised while initialising a backend +class BackendUnavailableException : public Exception { public: using Exception::Exception; }; +class ClRuntimeUnavailableException : public BackendUnavailableException +{ +public: + using BackendUnavailableException::BackendUnavailableException; +}; + class InvalidArgumentException : public Exception { public: -- cgit v1.2.1