Enable ModelBuilder::createCompilation (#156)
author이한종/동작제어Lab(SR)/Engineer/삼성전자 <hanjoung.lee@samsung.com>
Thu, 22 Mar 2018 09:34:28 +0000 (18:34 +0900)
committer최형규/동작제어Lab(SR)/Senior Engineer/삼성전자 <hk0110.choi@samsung.com>
Thu, 22 Mar 2018 09:34:28 +0000 (18:34 +0900)
Now that CompilationBuilder is available we can enable it.

src/runtime/ref/nn/runtime/ModelBuilder.cpp
src/runtime/ref/nn/runtime/ModelBuilder.h

index 3794b26..c3d25f2 100644 (file)
 
 #include "ModelBuilder.h"
 
+#include "CompilationBuilder.h"
+
 #if 0
 #define LOG_TAG "ModelBuilder"
 
-#include "CompilationBuilder.h"
 #include "Utils.h"
 
 #include <map>
@@ -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;
index 9a6bcbe..5ecee4b 100644 (file)
 #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