[enco] Do NOT use nncc::foundation::make_unique (#2657)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Thu, 13 Dec 2018 08:25:56 +0000 (17:25 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Thu, 13 Dec 2018 08:25:56 +0000 (17:25 +0900)
This commit replaces all the occurrences of
nncc::foundation::make_unique with stdex::make_unique.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
27 files changed:
contrib/enco/cli/CMakeLists.txt
contrib/enco/cli/src/Driver.cpp
contrib/enco/core/CMakeLists.txt
contrib/enco/core/src/ANN/Context.cpp
contrib/enco/core/src/ANN/IR/OperandInventory.cpp
contrib/enco/core/src/ANN/IR/OperationInventory.cpp
contrib/enco/core/src/ANN/IR/WeightInventory.cpp
contrib/enco/core/src/Backend.cpp
contrib/enco/core/src/CppGen/Host.cpp
contrib/enco/core/src/CppGen/Subnet.cpp
contrib/enco/core/src/Session.cpp
contrib/enco/core/src/Transforms/AvgPoolLowering.cpp
contrib/enco/core/src/Transforms/DataLayoutConversion.cpp
contrib/enco/core/src/Transforms/FeatureUnification.cpp
contrib/enco/core/src/Transforms/GlobalDataGeneration.cpp
contrib/enco/core/src/Transforms/Split.cpp
contrib/enco/frontend/caffe/CMakeLists.txt
contrib/enco/frontend/caffe/src/ConvolutionSpec.test.cpp
contrib/enco/frontend/caffe/src/Entry.cpp
contrib/enco/frontend/caffe/src/PoolingSpec.test.cpp
contrib/enco/frontend/tflite/src/Entry.cpp
contrib/enco/frontend/tflite/src/Frontend.test.cpp
contrib/enco/test/basic/000/CMakeLists.txt
contrib/enco/test/basic/000/enco.test.cpp
contrib/enco/test/binder.cpp
contrib/enco/test/caffe/CMakeLists.txt
contrib/enco/test/tflite/CMakeLists.txt

index 582ca67..96d2419 100644 (file)
@@ -5,5 +5,5 @@ target_include_directories(enco-cli PRIVATE src)
 target_link_libraries(enco-cli enco_intf_cmdline)
 target_link_libraries(enco-cli enco_intf_frontend)
 target_link_libraries(enco-cli enco_core)
-target_link_libraries(enco-cli nncc_foundation)
+target_link_libraries(enco-cli stdex)
 target_link_libraries(enco-cli dl)
index 15fcb7a..185bb13 100644 (file)
@@ -135,7 +135,7 @@ private:
 
 } // namespace
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <map>
 
@@ -153,7 +153,7 @@ static int entry(int argc, char **argv)
   std::map<std::string, std::function<void(const std::string &arg)>> argparse;
 
   argparse["--frontend"] = [&](const std::string &path) {
-    frontend_zone = nncc::foundation::make_unique<FrontendZone>(path);
+    frontend_zone = stdex::make_unique<FrontendZone>(path);
   };
 
   argparse["--frontend-arg"] = [&](const std::string &arg) { frontend_zone->append(arg); };
index 0c2fcd7..02723c1 100644 (file)
@@ -16,6 +16,7 @@ target_link_libraries(enco_core coco_core)
 target_link_libraries(enco_core coco_generic)
 target_link_libraries(enco_core pp)
 target_link_libraries(enco_core morph)
+target_link_libraries(enco_core stdex)
 
 nncc_find_package(GTest QUIET)
 
index 39a706c..d4d1882 100644 (file)
 
 #include "ANN/Context.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 ANNBinder *ANNContext::create(coco::Block *blk)
 {
-  auto mod = nncc::foundation::make_unique<ann::Module>();
-  auto obj = nncc::foundation::make_unique<ANNBinder>(blk, std::move(mod));
+  auto mod = stdex::make_unique<ann::Module>();
+  auto obj = stdex::make_unique<ANNBinder>(blk, std::move(mod));
   auto ptr = obj.get();
 
   _binders.emplace_back(std::move(obj));
index 432038e..c7ad388 100644 (file)
@@ -16,9 +16,9 @@
 
 #include "ANN/IR/OperandInventory.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace ann
 {
index 01bfe7f..37d48c1 100644 (file)
@@ -16,9 +16,9 @@
 
 #include "OperationInventory.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace ann
 {
index 5dde220..d8809ac 100644 (file)
@@ -16,9 +16,9 @@
 
 #include "WeightInventory.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace ann
 {
index 129aa53..1480127 100644 (file)
 #include "Transforms/Split.h"
 #include "Transforms/GlobalDataGeneration.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <stdexcept>
 #include <iostream>
 #include <fstream>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 using namespace enco;
 
 namespace
index 73c0be7..37e0583 100644 (file)
@@ -18,7 +18,7 @@
 
 #include <pp/EnclosedDocument.h>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <map>
 #include <string>
@@ -293,7 +293,7 @@ std::unique_ptr<pp::MultiLineText> HostBlockCompiler::compile(const coco::Block
 {
   InstrPrinter prn{_mem};
 
-  auto res = nncc::foundation::make_unique<pp::LinearDocument>();
+  auto res = stdex::make_unique<pp::LinearDocument>();
 
   for (auto ins = blk->instr()->head(); ins; ins = ins->next())
   {
index 9477704..a3c89c9 100644 (file)
 
 #include <pp/LinearDocument.h>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <sstream>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 using enco::concat;
 
 #define S(content) #content
@@ -379,7 +379,7 @@ std::unique_ptr<SubnetStruct> SubnetStructBuilder::build(const ANNBinder *binder
 
 std::unique_ptr<pp::MultiLineText> SubnetBlockCompiler::compile(const ANNBinder *binder) const
 {
-  auto res = nncc::foundation::make_unique<pp::LinearDocument>();
+  auto res = make_unique<pp::LinearDocument>();
 
   const auto compilation = _compilation_ctx.at(binder);
 
index f930faa..034f238 100644 (file)
 
 #include "Session.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <map>
 #include <memory>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index 3b90090..b398dba 100644 (file)
 #include <nncc/core/ADT/feature/Shape.h>
 #include <nncc/core/ADT/feature/HWCLayout.h>
 
-#include <nncc/foundation/Memory.h>
-
 #include <set>
 #include <cassert>
 
 using namespace nncc::core::ADT;
 using nncc::core::ADT::feature::num_elements;
 
-using nncc::foundation::make_unique;
-
 namespace
 {
 
index 524574b..29202a7 100644 (file)
 #include <nncc/core/ADT/feature/HWCLayout.h>
 #include <nncc/core/ADT/kernel/NHWCLayout.h>
 
-#include <nncc/foundation/Memory.h>
-
 #include <set>
 
-using nncc::foundation::make_unique;
-
 namespace
 {
 
index 95e79b5..56ac79f 100644 (file)
 #include "FeatureUnification.h"
 #include "IRUtils.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <set>
 #include <vector>
 
 #include <cassert>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index f45b63a..5c254b6 100644 (file)
 #include "Split.h"
 #include "Dims.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <map>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index 9ecb51b..40d7b7d 100644 (file)
 #include <coco/IR.h>
 
 #include <nncc/core/ADT/kernel/NHWCLayout.h>
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <map>
 #include <stdexcept>
 #include <functional>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index e50cdb4..5305042 100644 (file)
@@ -14,7 +14,6 @@ target_link_libraries(enco_caffe_frontend coco_core)
 target_link_libraries(enco_caffe_frontend coco_generic)
 target_link_libraries(enco_caffe_frontend enco_intf_frontend)
 target_link_libraries(enco_caffe_frontend enco_intf_cmdline)
-target_link_libraries(enco_caffe_frontend nncc_foundation)
 target_link_libraries(enco_caffe_frontend morph)
 target_link_libraries(enco_caffe_frontend caffeproto)
 target_link_libraries(enco_caffe_frontend stdex)
index 6f7bf64..02670b0 100644 (file)
@@ -18,7 +18,6 @@
 #include "Importer.h"
 
 #include <nncc/core/ADT/tensor/Shape.h>
-#include <nncc/foundation/Memory.h>
 
 #include <caffe/net.hpp>
 
@@ -29,8 +28,6 @@
 
 using namespace nncc::core::ADT;
 
-using nncc::foundation::make_unique;
-
 #define STRING(content) #content
 
 namespace
index 2b2e708..35b216e 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <cmdline/View.h>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <fstream>
 #include <cassert>
@@ -28,7 +28,7 @@ extern "C" std::unique_ptr<enco::Frontend> make_frontend(const cmdline::View &cm
 {
   assert(cmdline.size() == 2);
 
-  auto frontend = nncc::foundation::make_unique<Frontend>();
+  auto frontend = stdex::make_unique<Frontend>();
 
   // Fill prototxt
   {
index 1798c03..26bcaa0 100644 (file)
@@ -18,7 +18,6 @@
 #include "Importer.h"
 
 #include <nncc/core/ADT/tensor/Shape.h>
-#include <nncc/foundation/Memory.h>
 
 #include <caffe/net.hpp>
 
@@ -32,8 +31,6 @@
 
 using namespace nncc::core::ADT;
 
-using nncc::foundation::make_unique;
-
 #define STRING(content) #content
 
 bool from_txt(const std::string &txt, ::caffe::PoolingParameter &out)
index 6ce5d9e..c69e180 100644 (file)
 
 #include <cmdline/View.h>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <fstream>
 #include <cassert>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 extern "C" std::unique_ptr<enco::Frontend> make_frontend(const cmdline::View &cmdline)
 {
index 58e99d9..aee6099 100644 (file)
 
 #include "Frontend.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <gtest/gtest.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index ac64049..0ea8d5d 100644 (file)
@@ -11,6 +11,7 @@ set(LIB_TARGET ${PREFIX}-lib)
 add_library(${PREFIX}-frontend SHARED enco.test.cpp)
 target_link_libraries(${PREFIX}-frontend enco_intf_cmdline)
 target_link_libraries(${PREFIX}-frontend enco_intf_frontend)
+target_link_libraries(${PREFIX}-frontend stdex)
 
 # NOTE BYPRODUCTS are not specified in order to enforce source code generation
 add_custom_target(${SOURCE_TARGET}
index 5bd0b41..3dbf966 100644 (file)
@@ -19,7 +19,7 @@
 
 #include <nncc/core/ADT/tensor/LexicalLayout.h>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 using namespace nncc::core::ADT;
 
@@ -77,5 +77,5 @@ struct Frontend final : public enco::Frontend
 
 extern "C" std::unique_ptr<enco::Frontend> make_frontend(const cmdline::View &cmdline)
 {
-  return nncc::foundation::make_unique<Frontend>();
+  return stdex::make_unique<Frontend>();
 }
index 08a26be..c8c72fc 100644 (file)
@@ -46,9 +46,9 @@ void Network_invoke(Network *net);
 #include <nncc/core/ADT/tensor/LexicalLayout.h>
 #include <nncc/core/ADT/tensor/Overlay.h>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 using namespace nncc::core::ADT;
 
 namespace
@@ -184,5 +184,5 @@ private:
 
 extern "C" std::unique_ptr<nnkit::Backend> make_backend(const nnkit::CmdlineArguments &args)
 {
-  return nncc::foundation::make_unique<::Backend>();
+  return make_unique<::Backend>();
 }
index a93ff73..b5de5ea 100644 (file)
@@ -98,6 +98,7 @@ foreach(PREFIX IN ITEMS ${CANDIDATES})
   target_link_libraries(${BINDER_TARGET} nnkit_intf_backend)
   target_link_libraries(${BINDER_TARGET} ann_api)
   target_link_libraries(${BINDER_TARGET} ann_ref_static)
+  target_link_libraries(${BINDER_TARGET} stdex)
   set_target_properties(${BINDER_TARGET} PROPERTIES OUTPUT_NAME ${PREFIX})
   add_dependencies(${BINDER_TARGET} ${SOURCE_TARGET})
 
index cbe37cc..67c1224 100644 (file)
@@ -94,6 +94,7 @@ foreach(PREFIX IN ITEMS ${CANDIDATES})
   target_link_libraries(${BINDER_TARGET} nnkit_intf_backend)
   target_link_libraries(${BINDER_TARGET} ann_api)
   target_link_libraries(${BINDER_TARGET} ann_ref_static)
+  target_link_libraries(${BINDER_TARGET} stdex)
   set_target_properties(${BINDER_TARGET} PROPERTIES OUTPUT_NAME ${PREFIX})
   add_dependencies(${BINDER_TARGET} ${SOURCE_TARGET})