From: 이한종/동작제어Lab(SR)/Engineer/삼성전자 Date: Thu, 22 Mar 2018 09:34:28 +0000 (+0900) Subject: Enable ModelBuilder::createCompilation (#156) X-Git-Tag: 0.1~630 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=44d2419eb4caace1bafdea2c4800379ba48d13f4;p=platform%2Fcore%2Fml%2Fnnfw.git Enable ModelBuilder::createCompilation (#156) Now that CompilationBuilder is available we can enable it. --- diff --git a/src/runtime/ref/nn/runtime/ModelBuilder.cpp b/src/runtime/ref/nn/runtime/ModelBuilder.cpp index 3794b26..c3d25f2 100644 --- a/src/runtime/ref/nn/runtime/ModelBuilder.cpp +++ b/src/runtime/ref/nn/runtime/ModelBuilder.cpp @@ -17,10 +17,11 @@ #include "ModelBuilder.h" +#include "CompilationBuilder.h" + #if 0 #define LOG_TAG "ModelBuilder" -#include "CompilationBuilder.h" #include "Utils.h" #include @@ -293,21 +294,18 @@ int ModelBuilder::identifyInputsAndOutputs(uint32_t inputCount, const uint32_t* return ANEURALNETWORKS_NO_ERROR; #endif } -#if 0 // CompilationBuilder is needed. + int ModelBuilder::createCompilation(CompilationBuilder** compilation) { - // Dummy Implementation - return 0; -#if 0 if (!mCompletedModel) { - LOG(ERROR) << "ANeuralNetworksCompilation_create passed an unfinished model"; + // TODO-NNRT Uncomment once LOG is available + // LOG(ERROR) << "ANeuralNetworksCompilation_create passed an unfinished model"; *compilation = nullptr; return ANEURALNETWORKS_BAD_STATE; } *compilation = new CompilationBuilder(this); return (*compilation ? ANEURALNETWORKS_NO_ERROR : ANEURALNETWORKS_OUT_OF_MEMORY); -#endif } -#endif + int ModelBuilder::finish() { // Dummy Implementation return 0; diff --git a/src/runtime/ref/nn/runtime/ModelBuilder.h b/src/runtime/ref/nn/runtime/ModelBuilder.h index 9a6bcbe..5ecee4b 100644 --- a/src/runtime/ref/nn/runtime/ModelBuilder.h +++ b/src/runtime/ref/nn/runtime/ModelBuilder.h @@ -33,8 +33,10 @@ #endif namespace android { namespace nn { -#if 0 + class CompilationBuilder; + +#if 0 class Device; class ExecutionPlan; class ExecutionStep; @@ -57,9 +59,7 @@ public: int finish(); bool isFinished() const { return mCompletedModel; } -#if 0 // CompilationBuilder is needed. int createCompilation(CompilationBuilder** compilation); -#endif #if 0 // NeuralNetworksWrapper.h is needed. void setHidlModel(Model* model) const; #endif