diff options
author | 이한종/On-Device Lab./Engineer/삼성전자 <hanjoung.lee@samsung.com> | 2018-12-18 10:40:20 +0900 |
---|---|---|
committer | 오형석/On-Device Lab./Staff Engineer/삼성전자 <hseok82.oh@samsung.com> | 2018-12-18 10:40:20 +0900 |
commit | f95afb9e0b2a083a2cb681b52ef8ec83636b2bee (patch) | |
tree | 5e258aec1c4e4dd72866938e7223cbad4605ef42 /runtimes/neurun/test | |
parent | f3175727d3ff2b73ead31d626a913ea7a21d03f5 (diff) | |
download | nnfw-f95afb9e0b2a083a2cb681b52ef8ec83636b2bee.tar.gz nnfw-f95afb9e0b2a083a2cb681b52ef8ec83636b2bee.tar.bz2 nnfw-f95afb9e0b2a083a2cb681b52ef8ec83636b2bee.zip |
[neurun] Move operand files from graph to model (#4071)
Move pure model related classes from `graph/operand` to `model/operand`.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
Diffstat (limited to 'runtimes/neurun/test')
-rw-r--r-- | runtimes/neurun/test/backend/cpu/MemoryPlanner.cc | 8 | ||||
-rw-r--r-- | runtimes/neurun/test/graph/Graph.cc | 16 | ||||
-rw-r--r-- | runtimes/neurun/test/graph/MockNode.h | 2 | ||||
-rw-r--r-- | runtimes/neurun/test/graph/operand/IndexSet.cc | 10 | ||||
-rw-r--r-- | runtimes/neurun/test/graph/operand/Set.cc | 22 | ||||
-rw-r--r-- | runtimes/neurun/test/graph/operand/UseDef.cc | 6 | ||||
-rw-r--r-- | runtimes/neurun/test/graph/operation/SetIO.cc | 16 | ||||
-rw-r--r-- | runtimes/neurun/test/graph/verifier/Verifier.cc | 8 |
8 files changed, 44 insertions, 44 deletions
diff --git a/runtimes/neurun/test/backend/cpu/MemoryPlanner.cc b/runtimes/neurun/test/backend/cpu/MemoryPlanner.cc index 7aa65a5a5..04f2e5da4 100644 --- a/runtimes/neurun/test/backend/cpu/MemoryPlanner.cc +++ b/runtimes/neurun/test/backend/cpu/MemoryPlanner.cc @@ -17,7 +17,7 @@ #include <gtest/gtest.h> #include "backend/cpu/MemoryPlanner.h" -#include "graph/operand/Index.h" +#include "model/operand/Index.h" TEST(Allocator, allocate_test) { @@ -30,7 +30,7 @@ TEST(BumpPlanner, claim_test) ::neurun::backend::cpu::BumpPlanner planner; auto claim = [&planner](uint32_t index, size_t size, uint32_t expected_offset) { - ::neurun::graph::operand::Index mem_idx(index); + ::neurun::model::operand::Index mem_idx(index); planner.claim(mem_idx, size); auto mem_blk = planner.memory_plans()[mem_idx]; ASSERT_EQ(mem_blk.offset, expected_offset); @@ -47,7 +47,7 @@ TEST(FirstFitPlanner, claim_release_test) ::neurun::backend::cpu::FirstFitPlanner planner; auto claim = [&planner](uint32_t index, size_t size, uint32_t expected_offset) { - ::neurun::graph::operand::Index mem_idx(index); + ::neurun::model::operand::Index mem_idx(index); planner.claim(mem_idx, size); auto mem_blk = planner.memory_plans()[mem_idx]; ASSERT_EQ(mem_blk.offset, expected_offset); @@ -55,7 +55,7 @@ TEST(FirstFitPlanner, claim_release_test) }; auto release = [&planner](uint32_t index) { - ::neurun::graph::operand::Index mem_idx(index); + ::neurun::model::operand::Index mem_idx(index); planner.release(mem_idx); }; diff --git a/runtimes/neurun/test/graph/Graph.cc b/runtimes/neurun/test/graph/Graph.cc index 5de3c50d0..e6db3fe49 100644 --- a/runtimes/neurun/test/graph/Graph.cc +++ b/runtimes/neurun/test/graph/Graph.cc @@ -22,15 +22,15 @@ TEST(Graph, inputs_and_outputs) { ::neurun::graph::Graph graph; - ::neurun::graph::operand::Index index0{0u}; - ::neurun::graph::operand::Index index1{1u}; + ::neurun::model::operand::Index index0{0u}; + ::neurun::model::operand::Index index1{1u}; graph.addInput({index0}); graph.addInput({index1}); - ::neurun::graph::operand::Index index10{10u}; - ::neurun::graph::operand::Index index11{11u}; - ::neurun::graph::operand::Index index12{12u}; + ::neurun::model::operand::Index index10{10u}; + ::neurun::model::operand::Index index11{11u}; + ::neurun::model::operand::Index index12{12u}; graph.addOutput({index10}); graph.addOutput({index11}); @@ -39,9 +39,9 @@ TEST(Graph, inputs_and_outputs) ASSERT_EQ(graph.getInputs().size(), 2); ASSERT_EQ(graph.getOutputs().size(), 3); - ::neurun::graph::operand::IO::Index io_index0{0}; - ::neurun::graph::operand::IO::Index io_index1{1}; - ::neurun::graph::operand::IO::Index io_index2{2}; + ::neurun::model::operand::IO::Index io_index0{0}; + ::neurun::model::operand::IO::Index io_index1{1}; + ::neurun::model::operand::IO::Index io_index2{2}; ASSERT_EQ(graph.getInputs().at(io_index0), 0); ASSERT_EQ(graph.getInputs().at(io_index1), 1); diff --git a/runtimes/neurun/test/graph/MockNode.h b/runtimes/neurun/test/graph/MockNode.h index 4f4ea4de6..fe6ef0a4b 100644 --- a/runtimes/neurun/test/graph/MockNode.h +++ b/runtimes/neurun/test/graph/MockNode.h @@ -18,7 +18,7 @@ #define __NEURUN_TEST_GRAPH_MOCK_NODE_H__ #include "graph/operation/Node.h" -#include "graph/operand/IndexSet.h" +#include "model/operand/IndexSet.h" namespace neurun_test { diff --git a/runtimes/neurun/test/graph/operand/IndexSet.cc b/runtimes/neurun/test/graph/operand/IndexSet.cc index 8a494af39..de4768cda 100644 --- a/runtimes/neurun/test/graph/operand/IndexSet.cc +++ b/runtimes/neurun/test/graph/operand/IndexSet.cc @@ -16,10 +16,10 @@ #include <gtest/gtest.h> -#include "graph/operand/IndexSet.h" +#include "model/operand/IndexSet.h" -using neurun::graph::operand::Index; -using neurun::graph::operand::IndexSet; +using neurun::model::operand::Index; +using neurun::model::operand::IndexSet; TEST(graph_operand_IndexSet, append) { @@ -31,8 +31,8 @@ TEST(graph_operand_IndexSet, append) ASSERT_EQ(iset.size(), 5); - neurun::graph::operand::IO::Index index1{1}; - neurun::graph::operand::IO::Index index2{4}; + neurun::model::operand::IO::Index index1{1}; + neurun::model::operand::IO::Index index2{4}; ASSERT_EQ(iset.at(index1), 2); ASSERT_EQ(iset.at(index2), 10); diff --git a/runtimes/neurun/test/graph/operand/Set.cc b/runtimes/neurun/test/graph/operand/Set.cc index 176cedc38..00b6a7222 100644 --- a/runtimes/neurun/test/graph/operand/Set.cc +++ b/runtimes/neurun/test/graph/operand/Set.cc @@ -16,33 +16,33 @@ #include <gtest/gtest.h> -#include "graph/operand/Set.h" +#include "model/operand/Set.h" TEST(graph_operand_Set, set_test) { - neurun::graph::operand::Set set; + neurun::model::operand::Set set; - ::neurun::graph::operand::Shape shape0{3}; + ::neurun::model::operand::Shape shape0{3}; shape0.dim(0) = 1; shape0.dim(1) = 2; shape0.dim(2) = 3; - ::neurun::graph::operand::Shape shape1{4}; + ::neurun::model::operand::Shape shape1{4}; shape1.dim(0) = 10; shape1.dim(1) = 20; shape1.dim(2) = 30; shape1.dim(3) = 40; - ::neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + ::neurun::model::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; set.append(shape0, type); set.append(shape1, type); - ASSERT_EQ(set.exist(neurun::graph::operand::Index{0u}), true); - ASSERT_EQ(set.exist(neurun::graph::operand::Index{1u}), true); - ASSERT_EQ(set.exist(neurun::graph::operand::Index{2u}), false); + ASSERT_EQ(set.exist(neurun::model::operand::Index{0u}), true); + ASSERT_EQ(set.exist(neurun::model::operand::Index{1u}), true); + ASSERT_EQ(set.exist(neurun::model::operand::Index{2u}), false); - ASSERT_EQ(set.at(neurun::graph::operand::Index{0u}).shape().dim(0), 1); - ASSERT_EQ(set.at(neurun::graph::operand::Index{0u}).shape().dim(1), 2); - ASSERT_EQ(set.at(neurun::graph::operand::Index{0u}).shape().dim(2), 3); + ASSERT_EQ(set.at(neurun::model::operand::Index{0u}).shape().dim(0), 1); + ASSERT_EQ(set.at(neurun::model::operand::Index{0u}).shape().dim(1), 2); + ASSERT_EQ(set.at(neurun::model::operand::Index{0u}).shape().dim(2), 3); } diff --git a/runtimes/neurun/test/graph/operand/UseDef.cc b/runtimes/neurun/test/graph/operand/UseDef.cc index 4930e4aa3..e3792f746 100644 --- a/runtimes/neurun/test/graph/operand/UseDef.cc +++ b/runtimes/neurun/test/graph/operand/UseDef.cc @@ -26,7 +26,7 @@ namespace { -using IndexSet = neurun::graph::operand::IndexSet; +using IndexSet = neurun::model::operand::IndexSet; using MockNode = neurun_test::graph::SimpleMockNode; } // namespace anonymous @@ -36,8 +36,8 @@ TEST(graph_operand_usedef, usedef_test) neurun::graph::Graph graph; neurun::graph::verifier::DAGChecker verifier; - neurun::graph::operand::Shape shape{1u}; - neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + neurun::model::operand::Shape shape{1u}; + neurun::model::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; // Model Input/Output diff --git a/runtimes/neurun/test/graph/operation/SetIO.cc b/runtimes/neurun/test/graph/operation/SetIO.cc index 7e12c94b6..371026667 100644 --- a/runtimes/neurun/test/graph/operation/SetIO.cc +++ b/runtimes/neurun/test/graph/operation/SetIO.cc @@ -20,21 +20,21 @@ #include "cpp14/memory.h" #include "graph/operation/Conv2DNode.h" #include "graph/operation/ConcatNode.h" -#include "graph/operand/Index.h" -#include "graph/operand/IndexSet.h" +#include "model/operand/Index.h" +#include "model/operand/IndexSet.h" #include <stdexcept> -using Index = neurun::graph::operand::IO::Index; -using IndexSet = neurun::graph::operand::IndexSet; +using Index = neurun::model::operand::IO::Index; +using IndexSet = neurun::model::operand::IndexSet; using GraphNodeInitParam = neurun::graph::operation::Node::InitParam; TEST(graph_operation_setIO, operation_setIO_conv) { neurun::graph::Graph graph; - neurun::graph::operand::Shape shape{1u}; - neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + neurun::model::operand::Shape shape{1u}; + neurun::model::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; // Add Conv @@ -59,8 +59,8 @@ TEST(graph_operation_setIO, operation_setIO_concat) { neurun::graph::Graph graph; - neurun::graph::operand::Shape shape{1u}; - neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + neurun::model::operand::Shape shape{1u}; + neurun::model::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; // Add Concat diff --git a/runtimes/neurun/test/graph/verifier/Verifier.cc b/runtimes/neurun/test/graph/verifier/Verifier.cc index 46e8b8f5b..da0a3b4ea 100644 --- a/runtimes/neurun/test/graph/verifier/Verifier.cc +++ b/runtimes/neurun/test/graph/verifier/Verifier.cc @@ -20,10 +20,10 @@ #include "graph/Graph.h" #include "graph/verifier/Verifier.h" #include "cpp14/memory.h" -#include "graph/operand/Object.h" +#include "model/operand/Object.h" #include "../MockNode.h" -using IndexSet = neurun::graph::operand::IndexSet; +using IndexSet = neurun::model::operand::IndexSet; using MockNode = neurun_test::graph::SimpleMockNode; TEST(Verifier, dag_checker) @@ -31,8 +31,8 @@ TEST(Verifier, dag_checker) neurun::graph::Graph graph; neurun::graph::verifier::DAGChecker verifier; - ::neurun::graph::operand::Shape shape{1u}; - ::neurun::graph::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; + ::neurun::model::operand::Shape shape{1u}; + ::neurun::model::operand::TypeInfo type{ANEURALNETWORKS_TENSOR_INT32, 0, 0}; shape.dim(0) = 3; auto operand1 = graph.addOperand(shape, type); |