Enable to pass ValidationTestModel.Finish in pureacl (#2454)
author남궁석/동작제어Lab(SR)/Engineer/삼성전자 <sk.namkoong@samsung.com>
Fri, 24 Aug 2018 02:29:01 +0000 (11:29 +0900)
committer오형석/동작제어Lab(SR)/Staff Engineer/삼성전자 <hseok82.oh@samsung.com>
Fri, 24 Aug 2018 02:29:01 +0000 (11:29 +0900)
- Add checking if building model is finished or not

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

index 7a96038..ec0bdc8 100644 (file)
@@ -635,6 +635,11 @@ int ANeuralNetworksModel_finish(ANeuralNetworksModel *model)
     return ANEURALNETWORKS_UNEXPECTED_NULL;
   }
 
+  if (model->isFinished())
+  {
+    return ANEURALNETWORKS_BAD_STATE;
+  }
+
   model->markAsFinished();
 
   return ANEURALNETWORKS_NO_ERROR;