Enable to pass ValidationTestModel.CreateCompilation in pureacl (#2474)
author남궁석/동작제어Lab(SR)/Engineer/삼성전자 <sk.namkoong@samsung.com>
Mon, 27 Aug 2018 04:51:38 +0000 (13:51 +0900)
committer박세희/동작제어Lab(SR)/Principal Engineer/삼성전자 <saehie.park@samsung.com>
Mon, 27 Aug 2018 04:51:38 +0000 (13:51 +0900)
If building model is not finished, compilation cannot be created

- Add checking if building model is finished or not

Signed-off-by: Seok NamKoong <sk.namkoong@samsung.com>
runtimes/pure_arm_compute/src/compilation.cc

index 0990685..5f57405 100644 (file)
@@ -3835,6 +3835,11 @@ int ANeuralNetworksCompilation_create(ANeuralNetworksModel *model,
     return ANEURALNETWORKS_UNEXPECTED_NULL;
   }
 
+  if (!model->isFinished())
+  {
+    return ANEURALNETWORKS_BAD_STATE;
+  }
+
   std::shared_ptr<const internal::tflite::Model> internal;
 
   model->release(internal);