Fix format for pure acl runtime (#1435)
author오형석/동작제어Lab(SR)/Senior Engineer/삼성전자 <hseok82.oh@samsung.com>
Wed, 30 May 2018 07:53:27 +0000 (16:53 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Wed, 30 May 2018 07:53:27 +0000 (16:53 +0900)
Fix format for pure acl runtime
Enable format check for pure acl runtime

Signed-off-by: Hyeongseok Oh <hseok82.oh@samsung.com>
runtimes/pure_arm_compute/.FORMATCHECKED [new file with mode: 0644]
runtimes/pure_arm_compute/src/compilation.cc
runtimes/pure_arm_compute/src/event.cc
runtimes/pure_arm_compute/src/execution.cc
runtimes/pure_arm_compute/src/internal/layers/GenericReshapeLayer.cc
runtimes/pure_arm_compute/src/internal/layers/SimpleArithmeticAdditionLayer.h
runtimes/pure_arm_compute/src/memory.cc
runtimes/pure_arm_compute/src/model.cc
runtimes/pure_arm_compute/symbolcheck.cpp

diff --git a/runtimes/pure_arm_compute/.FORMATCHECKED b/runtimes/pure_arm_compute/.FORMATCHECKED
new file mode 100644 (file)
index 0000000..e69de29
index 0b580d9..6ad1c1c 100644 (file)
@@ -24,9 +24,9 @@
 #include "model.h"
 #include "logging.h"
 
-template<typename T> T from_env(const char *);
+template <typename T> T from_env(const char *);
 
-template<> bool from_env(const char *s)
+template <> bool from_env(const char *s)
 {
   if (s == nullptr)
   {
@@ -323,7 +323,7 @@ void Planner::visit(const ::internal::tflite::op::Add::Node &node)
 
     // NOTE CLArithmeticAddition emits incorrect values for ADAS model.
     // TODO Figure out why this happens, and fix it
-    if(from_env<bool>(std::getenv("USE_CL_ARITHMETIC_ADDTION")))
+    if (from_env<bool>(std::getenv("USE_CL_ARITHMETIC_ADDTION")))
     {
       auto l = make_layer<::arm_compute::CLArithmeticAddition>();
 
index 56b7946..9a406e1 100644 (file)
@@ -2,12 +2,6 @@
 
 #include "event.h"
 
-int ANeuralNetworksEvent_wait(ANeuralNetworksEvent *event)
-{
-  return ANEURALNETWORKS_NO_ERROR;
-}
+int ANeuralNetworksEvent_wait(ANeuralNetworksEvent *event) { return ANEURALNETWORKS_NO_ERROR; }
 
-void ANeuralNetworksEvent_free(ANeuralNetworksEvent *event)
-{
-  delete event;
-}
+void ANeuralNetworksEvent_free(ANeuralNetworksEvent *event) { delete event; }
index 731531f..f56a6bd 100644 (file)
@@ -149,8 +149,8 @@ int ANeuralNetworksExecution_create(ANeuralNetworksCompilation *compilation,
 }
 
 int ANeuralNetworksExecution_setInput(ANeuralNetworksExecution *execution, int32_t index,
-                                      const ANeuralNetworksOperandType *type,
-                                      const void *buffer, size_t length)
+                                      const ANeuralNetworksOperandType *type, const void *buffer,
+                                      size_t length)
 {
   const auto &operands = execution->plan().model().operands();
 
@@ -251,6 +251,4 @@ int ANeuralNetworksExecution_startCompute(ANeuralNetworksExecution *execution,
   return ANEURALNETWORKS_NO_ERROR;
 }
 
-void ANeuralNetworksExecution_free(ANeuralNetworksExecution *execution)
-{
-}
+void ANeuralNetworksExecution_free(ANeuralNetworksExecution *execution) {}
index 164dd29..b3e4488 100644 (file)
@@ -1,6 +1,7 @@
 #include "GenericReshapeLayer.h"
 
-void GenericReshapeLayer::configure(::arm_compute::ICLTensor *input, ::arm_compute::ICLTensor *output)
+void GenericReshapeLayer::configure(::arm_compute::ICLTensor *input,
+                                    ::arm_compute::ICLTensor *output)
 {
   _input = input;
   _output = output;
index 77f8962..aefa50d 100644 (file)
@@ -6,7 +6,8 @@
 class SimpleArithmeticAdditionLayer : public ::arm_compute::IFunction
 {
 public:
-  void configure(::arm_compute::ICLTensor *lhs, ::arm_compute::ICLTensor *rhs, ::arm_compute::ICLTensor *out)
+  void configure(::arm_compute::ICLTensor *lhs, ::arm_compute::ICLTensor *rhs,
+                 ::arm_compute::ICLTensor *out)
   {
     _lhs = lhs;
     _rhs = rhs;
index 7a951d7..9fca307 100644 (file)
@@ -11,10 +11,7 @@ int ANeuralNetworksMemory_createFromFd(size_t size, int protect, int fd, size_t
   return ANEURALNETWORKS_NO_ERROR;
 }
 
-void ANeuralNetworksMemory_free(ANeuralNetworksMemory *memory)
-{
-  delete memory;
-}
+void ANeuralNetworksMemory_free(ANeuralNetworksMemory *memory) { delete memory; }
 
 //
 // ANeuralNetworksMemory
index 60bc5c5..3e4cf5b 100644 (file)
@@ -13,10 +13,7 @@ int ANeuralNetworksModel_create(ANeuralNetworksModel **model)
   return ANEURALNETWORKS_NO_ERROR;
 }
 
-void ANeuralNetworksModel_free(ANeuralNetworksModel *model)
-{
-  delete model;
-}
+void ANeuralNetworksModel_free(ANeuralNetworksModel *model) { delete model; }
 
 int ANeuralNetworksModel_addOperand(ANeuralNetworksModel *model,
                                     const ANeuralNetworksOperandType *type)
@@ -54,8 +51,7 @@ int ANeuralNetworksModel_setOperandValue(ANeuralNetworksModel *model, int32_t in
   return ANEURALNETWORKS_NO_ERROR;
 }
 
-int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel *model,
-                                                   int32_t index,
+int ANeuralNetworksModel_setOperandValueFromMemory(ANeuralNetworksModel *model, int32_t index,
                                                    const ANeuralNetworksMemory *memory,
                                                    size_t offset, size_t length)
 {
@@ -233,10 +229,8 @@ int ANeuralNetworksModel_addOperation(ANeuralNetworksModel *model,
   return ANEURALNETWORKS_NO_ERROR;
 }
 
-int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel *model,
-                                                  uint32_t inputCount,
-                                                  const uint32_t *inputs,
-                                                  uint32_t outputCount,
+int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel *model, uint32_t inputCount,
+                                                  const uint32_t *inputs, uint32_t outputCount,
                                                   const uint32_t *outputs)
 {
   // NOTE ::internal::tflite::operand::Index uses int as its underlying type as various NNAPI
@@ -261,10 +255,7 @@ int ANeuralNetworksModel_identifyInputsAndOutputs(ANeuralNetworksModel *model,
   return ANEURALNETWORKS_NO_ERROR;
 }
 
-int ANeuralNetworksModel_finish(ANeuralNetworksModel *model)
-{
-  return ANEURALNETWORKS_NO_ERROR;
-}
+int ANeuralNetworksModel_finish(ANeuralNetworksModel *model) { return ANEURALNETWORKS_NO_ERROR; }
 
 //
 // ANeuralNetworksModel
index fdfb05e..bc937d7 100644 (file)
@@ -2,9 +2,10 @@
 
 #include <iostream>
 
-#define SHOW_FUNC_ENTRY(name) {                                                   \
-  std::cout << #name << " is at " << reinterpret_cast<void *>(name) << std::endl; \
-}
+#define SHOW_FUNC_ENTRY(name)                                                       \
+  {                                                                                 \
+    std::cout << #name << " is at " << reinterpret_cast<void *>(name) << std::endl; \
+  }
 
 int main(int argc, char **argv)
 {
@@ -35,10 +36,10 @@ int main(int argc, char **argv)
 
   // NOTE Pure CL runtime does not implement following NN API(s) as
   //      Tensorflow Lite does not use these API(s)
-  //SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_free);
-  //SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_setPreference);
-  //SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setInputFromMemory);
-  //SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setOutputFromMemory);
+  // SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_free);
+  // SHOW_FUNC_ENTRY(ANeuralNetworksCompilation_setPreference);
+  // SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setInputFromMemory);
+  // SHOW_FUNC_ENTRY(ANeuralNetworksExecution_setOutputFromMemory);
 
   return 0;
 }