Catch std::exception instead of armnn::Exception

Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Change-Id: I89ae4f3b607ccb83f1bf16e085c805d5fc5cf89c
diff --git a/1.2/ArmnnDriverImpl.cpp b/1.2/ArmnnDriverImpl.cpp
index 6ea9bc4..d369aa2 100644
--- a/1.2/ArmnnDriverImpl.cpp
+++ b/1.2/ArmnnDriverImpl.cpp
@@ -138,10 +138,10 @@
                                  OptOptions,
                                  errMessages);
     }
-    catch (armnn::Exception &e)
+    catch (std::exception &e)
     {
         std::stringstream message;
-        message << "armnn::Exception (" << e.what() << ") caught from optimize.";
+        message << "Exception (" << e.what() << ") caught from optimize.";
         FailPrepareModel(ErrorStatus::GENERAL_FAILURE, message.str(), cb);
         return ErrorStatus::NONE;
     }
@@ -173,10 +173,10 @@
             return FailPrepareModel(ErrorStatus::GENERAL_FAILURE, "Network could not be loaded", cb);
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
         std::stringstream message;
-        message << "armnn::Exception (" << e.what()<< ") caught from LoadNetwork.";
+        message << "Exception (" << e.what()<< ") caught from LoadNetwork.";
         FailPrepareModel(ErrorStatus::GENERAL_FAILURE, message.str(), cb);
         return ErrorStatus::NONE;
     }
@@ -204,7 +204,7 @@
         {
             clTunedParameters->Save(options.GetClTunedParametersFile().c_str());
         }
-        catch (const armnn::Exception& error)
+        catch (std::exception& error)
         {
             ALOGE("ArmnnDriverImpl::prepareModel: Failed to save CL tuned parameters file '%s': %s",
                   options.GetClTunedParametersFile().c_str(), error.what());
diff --git a/ArmnnDevice.cpp b/ArmnnDevice.cpp
index a03d9cc..34019c3 100644
--- a/ArmnnDevice.cpp
+++ b/ArmnnDevice.cpp
@@ -64,7 +64,7 @@
             {
                 m_ClTunedParameters->Load(m_Options.GetClTunedParametersFile().c_str());
             }
-            catch (const armnn::Exception& error)
+            catch (std::exception& error)
             {
                 // This is only a warning because the file won't exist the first time you are generating it.
                 ALOGW("ArmnnDevice: Failed to load CL tuned parameters file '%s': %s",
@@ -77,6 +77,10 @@
     {
         ALOGE("ArmnnDevice: Failed to setup CL runtime: %s. Device will be unavailable.", error.what());
     }
+    catch (std::exception& error)
+    {
+        ALOGE("ArmnnDevice: Unknown exception: %s. Device will be unavailable.", error.what());
+    }
 #endif
     runtimeOptions.m_EnableGpuProfiling = m_Options.IsGpuProfilingEnabled();
     m_Runtime = armnn::IRuntime::Create(runtimeOptions);
diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp
index de80445..9fe2c0e 100644
--- a/ArmnnDriverImpl.cpp
+++ b/ArmnnDriverImpl.cpp
@@ -108,10 +108,10 @@
                                  OptOptions,
                                  errMessages);
     }
-    catch (armnn::Exception &e)
+    catch (std::exception &e)
     {
         stringstream message;
-        message << "armnn::Exception (" << e.what() << ") caught from optimize.";
+        message << "Exception (" << e.what() << ") caught from optimize.";
         FailPrepareModel(ErrorStatus::GENERAL_FAILURE, message.str(), cb);
         return ErrorStatus::NONE;
     }
@@ -142,10 +142,10 @@
             return FailPrepareModel(ErrorStatus::GENERAL_FAILURE, "Network could not be loaded", cb);
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
         stringstream message;
-        message << "armnn::Exception (" << e.what()<< ") caught from LoadNetwork.";
+        message << "Exception (" << e.what()<< ") caught from LoadNetwork.";
         FailPrepareModel(ErrorStatus::GENERAL_FAILURE, message.str(), cb);
         return ErrorStatus::NONE;
     }
@@ -173,7 +173,7 @@
         {
             clTunedParameters->Save(options.GetClTunedParametersFile().c_str());
         }
-        catch (const armnn::Exception& error)
+        catch (std::exception& error)
         {
             ALOGE("ArmnnDriverImpl::prepareModel: Failed to save CL tuned parameters file '%s': %s",
                   options.GetClTunedParametersFile().c_str(), error.what());
diff --git a/ArmnnPreparedModel.cpp b/ArmnnPreparedModel.cpp
index 462970a..2f1abef 100644
--- a/ArmnnPreparedModel.cpp
+++ b/ArmnnPreparedModel.cpp
@@ -209,9 +209,9 @@
             pOutputTensors->emplace_back(i, outputTensor);
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("armnn::Exception caught while preparing for EnqueueWorkload: %s", e.what());
+        ALOGW("Exception caught while preparing for EnqueueWorkload: %s", e.what());
         NotifyCallbackAndCheck(callback, ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::execute");
         return ErrorStatus::GENERAL_FAILURE;
     }
@@ -253,9 +253,9 @@
             return;
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("armnn::Exception caught from EnqueueWorkload: %s", e.what());
+        ALOGW("Exception caught from EnqueueWorkload: %s", e.what());
         cb.callback(ErrorStatus::GENERAL_FAILURE, "ArmnnPreparedModel::ExecuteGraph");
         return;
     }
@@ -306,9 +306,9 @@
             return false;
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("ExecuteWithDummyInputs: armnn::Exception caught from EnqueueWorkload: %s", e.what());
+        ALOGW("ExecuteWithDummyInputs: Exception caught from EnqueueWorkload: %s", e.what());
         return false;
     }
     return true;
diff --git a/ArmnnPreparedModel_1_2.cpp b/ArmnnPreparedModel_1_2.cpp
index a7997c7..a1e481d 100644
--- a/ArmnnPreparedModel_1_2.cpp
+++ b/ArmnnPreparedModel_1_2.cpp
@@ -314,9 +314,9 @@
             pOutputTensors->emplace_back(i, outputTensor);
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("armnn::Exception caught while preparing for EnqueueWorkload: %s", e.what());
+        ALOGW("Exception caught while preparing for EnqueueWorkload: %s", e.what());
         cb(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming);
         return Void();
     }
@@ -345,9 +345,9 @@
             return Void();
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("armnn::Exception caught from EnqueueWorkload: %s", e.what());
+        ALOGW("Exception caught from EnqueueWorkload: %s", e.what());
         cb(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming);
         return Void();
     }
@@ -531,9 +531,9 @@
             return;
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("armnn::Exception caught from EnqueueWorkload: %s", e.what());
+        ALOGW("Exception caught from EnqueueWorkload: %s", e.what());
         cb.callback(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming,
                 "ArmnnPreparedModel_1_2::ExecuteGraph");
         return;
@@ -594,9 +594,9 @@
             return false;
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("ExecuteWithDummyInputs: armnn::Exception caught from EnqueueWorkload: %s", e.what());
+        ALOGW("ExecuteWithDummyInputs: Exception caught from EnqueueWorkload: %s", e.what());
         return false;
     }
     return true;
@@ -707,9 +707,9 @@
             }
         }
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
-        ALOGW("armnn::Exception caught while preparing for EnqueueWorkload: %s", e.what());
+        ALOGW("Exception caught while preparing for EnqueueWorkload: %s", e.what());
         callback(ErrorStatus::GENERAL_FAILURE, {}, g_NoTiming, "ArmnnPreparedModel_1_2::execute");
         return ErrorStatus::GENERAL_FAILURE;
     }
diff --git a/ConversionUtils.hpp b/ConversionUtils.hpp
index 9b24dc1..977a867 100644
--- a/ConversionUtils.hpp
+++ b/ConversionUtils.hpp
@@ -1807,7 +1807,7 @@
         concatDescriptor =
                 armnn::CreateDescriptorForConcatenation(inputShapes.begin(), inputShapes.end(), concatDim);
     }
-    catch (const armnn::Exception& error)
+    catch (std::exception& error)
     {
         return Fail("%s: Error preparing concat descriptor. %s", __func__, error.what());
     }
diff --git a/ModelToINetworkConverter.cpp b/ModelToINetworkConverter.cpp
index 4797ccf..05e6046 100644
--- a/ModelToINetworkConverter.cpp
+++ b/ModelToINetworkConverter.cpp
@@ -25,7 +25,7 @@
     {
         Convert();
     }
-    catch (armnn::Exception& e)
+    catch (std::exception& e)
     {
         m_ConversionResult = ConversionResult::UnsupportedFeature;
         ALOGE("%s: Unexpected exception: %s", __func__, e.what());