From bae3ed52528fac18122a08342e98297fca21613d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=EC=98=A4=ED=98=95=EC=84=9D/=EB=8F=99=EC=9E=91=EC=A0=9C?= =?utf8?q?=EC=96=B4Lab=28SR=29/Staff=20Engineer/=EC=82=BC=EC=84=B1?= =?utf8?q?=EC=A0=84=EC=9E=90?= Date: Fri, 7 Dec 2018 09:50:43 +0900 Subject: [PATCH] Return error for not finished model compile (#3897) When NNAPI call try to compile model not finished, return BAD_STATE error Signed-off-by: Hyeongseok Oh --- runtimes/neurun/src/frontend/compilation.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runtimes/neurun/src/frontend/compilation.cc b/runtimes/neurun/src/frontend/compilation.cc index a135eda..9b0719f 100644 --- a/runtimes/neurun/src/frontend/compilation.cc +++ b/runtimes/neurun/src/frontend/compilation.cc @@ -32,6 +32,11 @@ int ANeuralNetworksCompilation_create(ANeuralNetworksModel *model, return ANEURALNETWORKS_UNEXPECTED_NULL; } + if (!model->isFinished()) + { + return ANEURALNETWORKS_BAD_STATE; + } + std::shared_ptr internal; model->release(internal); -- 2.7.4