[coco] Use stdex::make_unique (#2690)
author박종현/동작제어Lab(SR)/Staff Engineer/삼성전자 <jh1302.park@samsung.com>
Mon, 17 Dec 2018 07:39:22 +0000 (16:39 +0900)
committerGitHub Enterprise <noreply-CODE@samsung.com>
Mon, 17 Dec 2018 07:39:22 +0000 (16:39 +0900)
This commit replaces all the occurrences of make_unique in
nncc::foundation with the alternative one in stdex.

Signed-off-by: Jonghyun Park <jh1302.park@samsung.com>
22 files changed:
contrib/coco/core/CMakeLists.txt
contrib/coco/core/src/IR.test.cpp
contrib/coco/core/src/IR/Bag.cpp
contrib/coco/core/src/IR/BagManager.cpp
contrib/coco/core/src/IR/BlockManager.cpp
contrib/coco/core/src/IR/Conv2D.test.cpp
contrib/coco/core/src/IR/Def.test.cpp
contrib/coco/core/src/IR/FeatureObject.test.cpp
contrib/coco/core/src/IR/InputManager.cpp
contrib/coco/core/src/IR/InstrManager.cpp
contrib/coco/core/src/IR/KernelObject.cpp
contrib/coco/core/src/IR/KernelObject.test.cpp
contrib/coco/core/src/IR/Module.cpp
contrib/coco/core/src/IR/Object.test.cpp
contrib/coco/core/src/IR/ObjectManager.cpp
contrib/coco/core/src/IR/OpManager.cpp
contrib/coco/core/src/IR/Ops.test.cpp
contrib/coco/core/src/IR/OutputManager.cpp
contrib/coco/core/src/IR/Part.test.cpp
contrib/coco/core/src/IR/Use.test.cpp
contrib/coco/generic/CMakeLists.txt
contrib/coco/generic/src/IR/Data.cpp

index e5d3056..ddbdaa2 100644 (file)
@@ -4,8 +4,9 @@ list(REMOVE_ITEM SOURCES ${TESTS})
 
 add_library(coco_core SHARED ${SOURCES})
 target_include_directories(coco_core PUBLIC include)
-target_link_libraries(coco_core nncc_foundation)
 target_link_libraries(coco_core nncc_core)
+# TODO Set this as PRIVATE dependency
+target_link_libraries(coco_core stdex)
 
 nncc_find_package(GTest QUIET)
 
index 678bb5e..3f8c0ad 100644 (file)
@@ -24,8 +24,6 @@
 
 #include <nncc/core/ADT/kernel/NCHWLayout.h>
 
-#include <nncc/foundation/Memory.h>
-
 #include <gtest/gtest.h>
 
 #include <set>
@@ -40,8 +38,6 @@ using nncc::core::ADT::tensor::LexicalLayout;
 using nncc::core::ADT::tensor::IndexEnumerator;
 using nncc::core::ADT::tensor::num_elements;
 
-using nncc::foundation::make_unique;
-
 //
 // 'caffe_conv' test demonstrates how to translate the following Caffe network into coco IR:
 //
index 67e6f38..7dce485 100644 (file)
@@ -20,8 +20,6 @@
 #include "coco/IR/Read.h"
 #include "coco/IR/Update.h"
 
-#include <nncc/foundation/Memory.h>
-
 #include <cassert>
 
 namespace coco
index bbd9a75..10fe69d 100644 (file)
 
 #include "coco/IR/BagManager.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 namespace coco
 {
 
 Bag *BagManager::create(uint32_t size)
 {
-  auto bag = nncc::foundation::make_unique<Bag>(size);
+  auto bag = stdex::make_unique<Bag>(size);
   modulize(bag.get());
   return take(std::move(bag));
 }
index b5e7493..5e3b881 100644 (file)
@@ -16,7 +16,7 @@
 
 #include "coco/IR/BlockManager.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <cassert>
 
@@ -25,7 +25,7 @@ namespace coco
 
 Block *BlockManager::create(void)
 {
-  auto blk = nncc::foundation::make_unique<Block>();
+  auto blk = stdex::make_unique<Block>();
   modulize(blk.get());
   return take(std::move(blk));
 }
index 1858ea1..df0a247 100644 (file)
 #include <vector>
 #include <memory>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <gtest/gtest.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index addbd3b..98455c0 100644 (file)
 
 #include "coco/IR/FeatureObject.h"
 
-#include "nncc/foundation/Memory.h"
+#include <stdex/Memory.h>
 
 #include "Producer.mock.h"
 
 #include <gtest/gtest.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index f647626..23188f8 100644 (file)
 #include "coco/IR/FeatureObject.h"
 #include "coco/IR/FeatureLayouts.h"
 
-#include <nncc/foundation/Memory.h>
-
 #include <vector>
 #include <memory>
 
 #include <gtest/gtest.h>
 
 using namespace nncc::core::ADT;
-using nncc::foundation::make_unique;
 
 namespace
 {
index e5bcb7f..6d5b947 100644 (file)
 
 #include "coco/IR/InputManager.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 namespace coco
 {
 
 Input *InputManager::create(const nncc::core::ADT::tensor::Shape &shape)
 {
-  auto input = nncc::foundation::make_unique<Input>(shape);
+  auto input = stdex::make_unique<Input>(shape);
   modulize(input.get());
   return take(std::move(input));
 }
index e641940..32f1cbf 100644 (file)
@@ -18,8 +18,6 @@
 
 #include "coco/IR/Op.h"
 
-#include <nncc/foundation/Memory.h>
-
 #include <cassert>
 
 namespace coco
index 507c666..79c298b 100644 (file)
@@ -18,9 +18,6 @@
 #include "coco/IR/KernelLayouts.h"
 
 #include <nncc/core/ADT/kernel/NCHWLayout.h>
-#include <nncc/foundation/Memory.h>
-
-using nncc::foundation::make_unique;
 
 namespace coco
 {
index 64f4d54..4aeba23 100644 (file)
 
 #include "coco/IR/KernelObject.h"
 
-#include <nncc/foundation/Memory.h>
-
 #include <vector>
 #include <memory>
 
 #include <gtest/gtest.h>
 
 using namespace nncc::core::ADT;
-using nncc::foundation::make_unique;
 
 namespace
 {
index 331e842..0b65cee 100644 (file)
@@ -16,9 +16,9 @@
 
 #include "coco/IR/Module.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {
index dd3466c..2a2e4db 100644 (file)
 #include "coco/IR/Object.h"
 #include "coco/IR/BagManager.h"
 
-#include <nncc/foundation/Memory.h>
-
 #include <vector>
 
 #include <gtest/gtest.h>
 
-using nncc::foundation::make_unique;
-
 namespace
 {
 class ObjectTest : public ::testing::Test
index 7953002..1b7215a 100644 (file)
 #include "coco/IR/FeatureObject.h"
 #include "coco/IR/KernelObject.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <cassert>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace coco
 {
index 3911eb6..c87b704 100644 (file)
 
 #include "coco/IR/OpManager.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <cassert>
 #include <queue>
 #include <set>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace coco
 {
index 61fa893..965708b 100644 (file)
 #include <vector>
 #include <memory>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <gtest/gtest.h>
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 /**
  * Section: Add Op
index 7e6e314..86b9580 100644 (file)
 
 #include "coco/IR/OutputManager.h"
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 namespace coco
 {
 
 Output *OutputManager::create(const nncc::core::ADT::tensor::Shape &shape)
 {
-  auto output = nncc::foundation::make_unique<Output>(shape);
+  auto output = stdex::make_unique<Output>(shape);
   modulize(output.get());
   return take(std::move(output));
 }
index 3f11d7e..87e0e15 100644 (file)
 #include "coco/IR/Part.h"
 #include "coco/IR/Op.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 3cad13d..3191e98 100644 (file)
 
 #include "Consumer.mock.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 a2d404f..a976f16 100644 (file)
@@ -5,6 +5,8 @@ list(REMOVE_ITEM SOURCES ${TESTS})
 add_library(coco_generic SHARED ${SOURCES})
 target_include_directories(coco_generic PUBLIC include)
 target_link_libraries(coco_generic coco_core)
+# TODO Set this as PRIVATE dependency
+target_link_libraries(coco_generic stdex)
 
 nncc_find_package(GTest QUIET)
 
index 57d3277..b719472 100644 (file)
 #include <nncc/core/ADT/kernel/NCHWLayout.h>
 #include <nncc/core/ADT/kernel/Overlay.h>
 
-#include <nncc/foundation/Memory.h>
+#include <stdex/Memory.h>
 
 #include <map>
 
 using namespace nncc::core::ADT;
 
-using nncc::foundation::make_unique;
+using stdex::make_unique;
 
 namespace
 {