Make NN API methods return enum value for error
authorHanjoung Lee <hanjoung.lee@samsung.com>
Wed, 21 Mar 2018 07:41:33 +0000 (16:41 +0900)
committer최형규/동작제어Lab(SR)/Senior Engineer/삼성전자 <hk0110.choi@samsung.com>
Thu, 22 Mar 2018 04:43:25 +0000 (13:43 +0900)
Rather than return magic number 0.

src/runtime/ref/nn/runtime/NeuralNetworks.cpp

index 47a833c..4fb90c6 100644 (file)
@@ -227,7 +227,7 @@ using namespace android::nn;
 int ANeuralNetworksMemory_createFromFd(size_t size, int prot, int fd, size_t offset,
                                        ANeuralNetworksMemory** memory) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -279,7 +279,7 @@ void ANeuralNetworksModel_free(ANeuralNetworksModel* model) {
 
 int ANeuralNetworksModel_finish(ANeuralNetworksModel* model) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -295,7 +295,7 @@ int ANeuralNetworksModel_finish(ANeuralNetworksModel* model) {
 int ANeuralNetworksModel_addOperand(ANeuralNetworksModel* model,
                                     const ANeuralNetworksOperandType* type) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -311,7 +311,7 @@ int ANeuralNetworksModel_addOperand(ANeuralNetworksModel* model,
 int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel* model, int32_t index,
                                          const void* buffer, size_t length) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -328,7 +328,7 @@ int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel* model,
                                                    const ANeuralNetworksMemory* memory,
                                                    size_t offset, size_t length) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -347,7 +347,7 @@ int ANeuralNetworksModel_addOperation(ANeuralNetworksModel* model,
                                       const uint32_t* inputs, uint32_t outputCount,
                                       const uint32_t* outputs) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -364,7 +364,7 @@ int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel* model, u
                                                   const uint32_t* inputs, uint32_t outputCount,
                                                   const uint32_t* outputs) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -380,7 +380,7 @@ int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel* model, u
 int ANeuralNetworksCompilation_create(ANeuralNetworksModel* model,
                                       ANeuralNetworksCompilation** compilation) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -410,7 +410,7 @@ void ANeuralNetworksCompilation_free(ANeuralNetworksCompilation* compilation) {
 int ANeuralNetworksCompilation_setPreference(ANeuralNetworksCompilation* compilation,
                                              int32_t preference) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -425,7 +425,7 @@ int ANeuralNetworksCompilation_setPreference(ANeuralNetworksCompilation* compila
 
 int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation* compilation) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -441,7 +441,7 @@ int ANeuralNetworksCompilation_finish(ANeuralNetworksCompilation* compilation) {
 int ANeuralNetworksExecution_create(ANeuralNetworksCompilation* compilation,
                                     ANeuralNetworksExecution** execution) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -472,7 +472,7 @@ int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution* execution, int32
                                       const ANeuralNetworksOperandType* type, const void* buffer,
                                       size_t length) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -491,7 +491,7 @@ int ANeuralNetworksExecution_setInputFromMemory(ANeuralNetworksExecution* execut
                                                 const ANeuralNetworksMemory* memory, size_t offset,
                                                 size_t length) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -510,7 +510,7 @@ int ANeuralNetworksExecution_setOutput(ANeuralNetworksExecution* execution, int3
                                        const ANeuralNetworksOperandType* type, void* buffer,
                                        size_t length) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -528,7 +528,7 @@ int ANeuralNetworksExecution_setOutputFromMemory(ANeuralNetworksExecution* execu
                                                  const ANeuralNetworksMemory* memory, size_t offset,
                                                  size_t length) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -546,7 +546,7 @@ int ANeuralNetworksExecution_setOutputFromMemory(ANeuralNetworksExecution* execu
 int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution* execution,
                                           ANeuralNetworksEvent** event) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0
@@ -578,7 +578,7 @@ int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution* execution,
 
 int ANeuralNetworksEvent_wait(ANeuralNetworksEvent* event) {
     // Dummy Implementation
-    return 0;
+    return ANEURALNETWORKS_NO_ERROR;
 
     // Original code for reference
 #if 0