IVGCVSW-1929: Optimize function signature change

* Optimize now returns reasons for failure

!armnn:152481

Change-Id: I1cd7f5796b3c469e9baecbed80e392ac74e40ef4
diff --git a/ArmnnDriverImpl.cpp b/ArmnnDriverImpl.cpp
index 5d21365..267574c 100644
--- a/ArmnnDriverImpl.cpp
+++ b/ArmnnDriverImpl.cpp
@@ -150,12 +150,14 @@
     armnn::OptimizerOptions OptOptions;
     OptOptions.m_ReduceFp32ToFp16 = float32ToFloat16;
 
+    std::vector<std::string> errMessages;
     try
     {
         optNet = armnn::Optimize(*modelConverter.GetINetwork(),
                                  {options.GetComputeDevice()},
                                  runtime->GetDeviceSpec(),
-                                 OptOptions);
+                                 OptOptions,
+                                 errMessages);
     }
     catch (armnn::Exception &e)
     {
@@ -168,8 +170,13 @@
     // Check that the optimized network is valid.
     if (!optNet)
     {
+        stringstream message;
+        message << "ArmnnDriverImpl::prepareModel: Invalid optimized network";
+        for (const string& msg : errMessages) {
+            message << "\n" << msg;
+        }
         FailPrepareModel(ErrorStatus::GENERAL_FAILURE,
-                         "ArmnnDriverImpl::prepareModel: Invalid optimized network", cb);
+                         message.str(), cb);
         return ErrorStatus::NONE;
     }