summaryrefslogtreecommitdiff
path: root/compiler/locop/src
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/locop/src')
-rw-r--r--compiler/locop/src/CanonicalNodeSummaryBuilder.cpp2
-rw-r--r--compiler/locop/src/ExampleGraph.h4
-rw-r--r--compiler/locop/src/FormattedGraph.cpp5
-rw-r--r--compiler/locop/src/FormattedGraph.test.cpp12
-rw-r--r--compiler/locop/src/FormattedTensorShape.cpp2
-rw-r--r--compiler/locop/src/FormattedTensorShape.test.cpp18
-rw-r--r--compiler/locop/src/GenericNodeSummaryBuilder.test.cpp7
-rw-r--r--compiler/locop/src/NodeSummary.cpp7
8 files changed, 33 insertions, 24 deletions
diff --git a/compiler/locop/src/CanonicalNodeSummaryBuilder.cpp b/compiler/locop/src/CanonicalNodeSummaryBuilder.cpp
index 61d9e8ae7..75dd39f36 100644
--- a/compiler/locop/src/CanonicalNodeSummaryBuilder.cpp
+++ b/compiler/locop/src/CanonicalNodeSummaryBuilder.cpp
@@ -25,8 +25,6 @@
#include <pp/Format.h>
-#include <stdex/Memory.h>
-
#include <map>
#include <set>
diff --git a/compiler/locop/src/ExampleGraph.h b/compiler/locop/src/ExampleGraph.h
index 76813bcd8..84010f75b 100644
--- a/compiler/locop/src/ExampleGraph.h
+++ b/compiler/locop/src/ExampleGraph.h
@@ -19,7 +19,7 @@
#include <loco.h>
-#include <stdex/Memory.h>
+#include <memory>
namespace
{
@@ -55,7 +55,7 @@ template <> std::unique_ptr<Bundle<PullPush>> make_bundle(void)
push->from(pull);
- auto res = stdex::make_unique<Bundle<PullPush>>();
+ auto res = std::make_unique<Bundle<PullPush>>();
res->g = std::move(g);
res->pull = pull;
diff --git a/compiler/locop/src/FormattedGraph.cpp b/compiler/locop/src/FormattedGraph.cpp
index bf4175768..94bfbd2f8 100644
--- a/compiler/locop/src/FormattedGraph.cpp
+++ b/compiler/locop/src/FormattedGraph.cpp
@@ -23,8 +23,7 @@
#include <pp/Format.h>
-#include <stdex/Memory.h>
-
+#include <memory>
#include <map>
#include <set>
@@ -300,7 +299,7 @@ void FormattedGraphImpl<Formatter::LinearV1>::dump(std::ostream &os) const
else
{
// Use Built-in NodeSummaryBuilder otherwise
- node_summary_builder = stdex::make_unique<GenericNodeSummaryBuilder>(&symbols);
+ node_summary_builder = std::make_unique<GenericNodeSummaryBuilder>(&symbols);
}
// Print Graph Input(s)
diff --git a/compiler/locop/src/FormattedGraph.test.cpp b/compiler/locop/src/FormattedGraph.test.cpp
index aff9ebe5f..9f11a4e5d 100644
--- a/compiler/locop/src/FormattedGraph.test.cpp
+++ b/compiler/locop/src/FormattedGraph.test.cpp
@@ -17,7 +17,7 @@
#include "locop/FormattedGraph.h"
#include "ExampleGraph.h"
-#include <stdex/Memory.h>
+#include <memory>
#include <gtest/gtest.h>
@@ -42,7 +42,7 @@ TEST(LinearV1FormatterTest, user_defined_node_summary_builder)
auto bundle = make_bundle<PullPush>();
auto g = bundle->graph();
{
- bundle->push->annot(stdex::make_unique<MyAnnotation>());
+ bundle->push->annot(std::make_unique<MyAnnotation>());
}
struct MyBuilder final : public locop::NodeSummaryBuilder
@@ -63,11 +63,11 @@ TEST(LinearV1FormatterTest, user_defined_node_summary_builder)
{
std::unique_ptr<locop::NodeSummaryBuilder> create(const locop::SymbolTable *) const final
{
- return stdex::make_unique<MyBuilder>();
+ return std::make_unique<MyBuilder>();
}
};
- std::cout << locop::fmt<locop::LinearV1>(g).with(stdex::make_unique<MyFactory>()) << std::endl;
+ std::cout << locop::fmt<locop::LinearV1>(g).with(std::make_unique<MyFactory>()) << std::endl;
// TODO Check whether MyBuilder actually sees all the nodes in a graph
SUCCEED();
@@ -134,11 +134,11 @@ TEST(LinearV1FormatterTest, node_summary_builder_composition)
{
std::unique_ptr<locop::NodeSummaryBuilder> create(const locop::SymbolTable *tbl) const final
{
- return stdex::make_unique<CompositeBuilder>(tbl);
+ return std::make_unique<CompositeBuilder>(tbl);
}
};
- std::cout << locop::fmt<locop::LinearV1>(g).with(stdex::make_unique<MyFactory>()) << std::endl;
+ std::cout << locop::fmt<locop::LinearV1>(g).with(std::make_unique<MyFactory>()) << std::endl;
// TODO Check whether MyBuilder actually sees all the nodes in a graph
SUCCEED();
diff --git a/compiler/locop/src/FormattedTensorShape.cpp b/compiler/locop/src/FormattedTensorShape.cpp
index b2b6ea074..bc6310313 100644
--- a/compiler/locop/src/FormattedTensorShape.cpp
+++ b/compiler/locop/src/FormattedTensorShape.cpp
@@ -25,7 +25,7 @@ std::ostream &operator<<(std::ostream &os, const loco::Dimension &d)
return os;
}
-} // namespace
+} // namespace loco
namespace locop
{
diff --git a/compiler/locop/src/FormattedTensorShape.test.cpp b/compiler/locop/src/FormattedTensorShape.test.cpp
index fc85df3a6..626b6cc23 100644
--- a/compiler/locop/src/FormattedTensorShape.test.cpp
+++ b/compiler/locop/src/FormattedTensorShape.test.cpp
@@ -16,7 +16,7 @@
#include "locop/FormattedTensorShape.h"
-#include <stdex/Memory.h>
+#include <memory>
#include <gtest/gtest.h>
@@ -24,12 +24,26 @@ using namespace locop;
TEST(FormattedTensorShapeTest, BracketFormat)
{
- auto tensor_shape = stdex::make_unique<loco::TensorShape>();
+ auto tensor_shape = std::make_unique<loco::TensorShape>();
tensor_shape->rank(2);
tensor_shape->dim(0) = 4;
+ tensor_shape->dim(1) = 8;
std::cout << fmt<TensorShapeFormat::Bracket>(tensor_shape.get()) << std::endl;
SUCCEED();
}
+
+TEST(FormattedTensorShapeTest, PlainFormat)
+{
+ auto tensor_shape = std::make_unique<loco::TensorShape>();
+
+ tensor_shape->rank(2);
+ tensor_shape->dim(0) = 4;
+ tensor_shape->dim(1) = 8;
+
+ std::cout << fmt<TensorShapeFormat::Plain>(tensor_shape.get()) << std::endl;
+
+ SUCCEED();
+}
diff --git a/compiler/locop/src/GenericNodeSummaryBuilder.test.cpp b/compiler/locop/src/GenericNodeSummaryBuilder.test.cpp
index d688b5490..cfa82c2a2 100644
--- a/compiler/locop/src/GenericNodeSummaryBuilder.test.cpp
+++ b/compiler/locop/src/GenericNodeSummaryBuilder.test.cpp
@@ -17,8 +17,7 @@
#include "locop/GenericNodeSummaryBuilder.h"
#include "locop/FormattedGraph.h"
-#include <stdex/Memory.h>
-
+#include <memory>
#include <stdexcept>
#include <gtest/gtest.h>
@@ -44,7 +43,7 @@ TEST(GenericNodeSummaryBuilderTest, simple)
{
std::unique_ptr<locop::NodeSummaryBuilder> create(const locop::SymbolTable *tbl) const final
{
- return stdex::make_unique<locop::GenericNodeSummaryBuilder>(tbl);
+ return std::make_unique<locop::GenericNodeSummaryBuilder>(tbl);
}
};
@@ -52,7 +51,7 @@ TEST(GenericNodeSummaryBuilderTest, simple)
g->nodes()->create<MockNode>();
- std::cout << locop::fmt<locop::LinearV1>(g).with(stdex::make_unique<MockFactory>()) << std::endl;
+ std::cout << locop::fmt<locop::LinearV1>(g).with(std::make_unique<MockFactory>()) << std::endl;
SUCCEED();
}
diff --git a/compiler/locop/src/NodeSummary.cpp b/compiler/locop/src/NodeSummary.cpp
index 3f8856997..20250a90f 100644
--- a/compiler/locop/src/NodeSummary.cpp
+++ b/compiler/locop/src/NodeSummary.cpp
@@ -16,8 +16,7 @@
#include "locop/NodeSummary.h"
-#include <stdex/Memory.h>
-
+#include <memory>
#include <cassert>
namespace locop
@@ -36,6 +35,6 @@ const std::string &NodeDesc::opname(void) const
return *_name;
}
-void NodeDesc::opname(const std::string &v) { _name = stdex::make_unique<std::string>(v); }
+void NodeDesc::opname(const std::string &v) { _name = std::make_unique<std::string>(v); }
-} // namespace loco
+} // namespace locop