Commit 8a6c08df authored by Avijit's avatar Avijit Committed by GitHub

Fixed the paths in the include statements in the files below. (#104)

* Fixed the paths in the include statements

* absolute path include, relative to /src

* fix invalid use of incomplete type

* Fixed a compilation error.
parent 11a78e5f
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include "ngraph.hpp"
#include "ngraph/ngraph.hpp"
using namespace std;
using namespace ngraph;
......@@ -28,3 +28,8 @@ Input::Input(
{
output->add_input(this);
}
std::shared_ptr<Node> Input::get_node()
{
return m_node->shared_from_this();
}
......@@ -40,7 +40,7 @@ namespace ngraph
size_t arg_index,
const std::shared_ptr<Output>& output);
std::shared_ptr<Node> get_node() { return m_node->shared_from_this(); }
std::shared_ptr<Node> get_node();
size_t get_argno() const { return m_argno; }
size_t get_arg_index() const { return m_arg_index; }
size_t get_index() const { return m_index; }
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include "ngraph.hpp"
#include "ngraph/ngraph.hpp"
using namespace std;
using namespace ngraph;
......@@ -30,3 +30,8 @@ void Output::add_input(Input* input)
{
m_inputs.insert(input);
}
std::shared_ptr<Node> Output::get_node() const
{
return m_node->shared_from_this();
}
......@@ -17,7 +17,7 @@
#include <memory>
#include <set>
#include "descriptor/tensor_view.hpp"
#include "ngraph/descriptor/tensor_view.hpp"
namespace ngraph
{
......@@ -35,11 +35,11 @@ namespace ngraph
/// @param tensor_view The view of this tensor; where the value will be written
Output(Node* node, size_t index, const std::shared_ptr<TensorView>& tensor_view);
std::shared_ptr<Node> get_node() const { return m_node->shared_from_this(); }
std::shared_ptr<Node> get_node() const;
size_t get_index() const { return m_index; }
std::shared_ptr<TensorView> get_tensor_view() const { return m_tensor_view; }
void add_input(Input* input);
const std::set<Input*>& get_inputs() const { return m_inputs; }
void add_input(Input* input);
const std::set<Input*>& get_inputs() const { return m_inputs; }
protected:
Node* m_node;
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include "descriptor/tensor.hpp"
#include "ngraph/descriptor/tensor.hpp"
using namespace ngraph;
using namespace descriptor;
......
......@@ -12,7 +12,7 @@
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include "descriptor/tensor_view.hpp"
#include "ngraph/descriptor/tensor_view.hpp"
using namespace ngraph;
using namespace descriptor;
......
......@@ -14,9 +14,9 @@
#pragma once
#include "descriptor/tensor.hpp"
#include "shape.hpp"
#include "type.hpp"
#include "ngraph/descriptor/tensor.hpp"
#include "ngraph/shape.hpp"
#include "ngraph/type.hpp"
namespace ngraph
{
......
......@@ -22,7 +22,7 @@
#include <string>
#include <type_traits>
#include "except.hpp"
#include "ngraph/except.hpp"
namespace ngraph
{
......@@ -32,6 +32,7 @@ namespace ngraph
{
Type(const Type&) = delete;
Type& operator=(const Type&) = delete;
public:
Type(size_t bitwidth, bool is_float, bool is_signed, const std::string& cname);
......@@ -43,8 +44,8 @@ namespace ngraph
return h(m_cname);
}
bool operator==(const Type& other) const;
bool operator!=(const Type& other) const { return !(*this == other); }
bool operator==(const Type& other) const;
bool operator!=(const Type& other) const { return !(*this == other); }
friend std::ostream& operator<<(std::ostream&, const Type&);
private:
......@@ -55,6 +56,8 @@ namespace ngraph
const std::string& m_cname;
};
std::ostream& operator<<(std::ostream& out, const ngraph::element::Type& obj);
// Provides a compile-time name for a C++ type.
// Used in TraitedType for the string that supplies the C++ type name during code generation,
// so it needs to be a valid C++ name.
......@@ -65,7 +68,7 @@ namespace ngraph
}
// Define a type string for a type T. Will make traited_type_name<T>() return "T"
#define NGRAPH_DEFINE_TRAITED_TYPE_NAME(T) \
#define NGRAPH_DEFINE_TRAITED_TYPE_NAME(T) \
template <> \
constexpr const char* traited_type_name<T>() \
{ \
......@@ -80,6 +83,7 @@ namespace ngraph
{
TraitedType(const TraitedType&) = delete;
TraitedType& operator=(const TraitedType&) = delete;
protected:
TraitedType()
: Type(sizeof(T) * 8,
......
......@@ -14,10 +14,10 @@
#pragma once
#include "node.hpp"
#include "op.hpp"
#include "ops/parameter.hpp"
#include "type.hpp"
#include "ngraph/node.hpp"
#include "ngraph/op.hpp"
#include "ngraph/ops/parameter.hpp"
#include "ngraph/type.hpp"
namespace ngraph
{
......@@ -25,10 +25,10 @@ namespace ngraph
class Function
{
public:
Function(const std::shared_ptr<Node>& result,
Function(const std::shared_ptr<Node>& result,
const std::vector<std::shared_ptr<op::Parameter>>& parameters);
std::shared_ptr<Node> get_result() { return m_result; }
std::shared_ptr<Node> get_result() { return m_result; }
const std::vector<std::shared_ptr<op::Parameter>> get_parameters() const
{
return m_parameters;
......
......@@ -18,29 +18,29 @@
#pragma once
#include "common.hpp"
#include "element_type.hpp"
#include "except.hpp"
#include "function.hpp"
#include "node.hpp"
#include "descriptor/input.hpp"
#include "descriptor/output.hpp"
#include "descriptor/tensor_view.hpp"
#include "descriptor/tensor_view_layout.hpp"
#include "descriptor/tensor.hpp"
#include "op.hpp"
#include "ops/add.hpp"
#include "ops/broadcast.hpp"
#include "ops/ceiling.hpp"
#include "ops/concatenate.hpp"
#include "ops/constant.hpp"
#include "ops/convert.hpp"
#include "ops/divide.hpp"
#include "ops/dot.hpp"
#include "ops/floor.hpp"
#include "ops/multiply.hpp"
#include "ops/parameter.hpp"
#include "ops/subtract.hpp"
#include "ops/tuple.hpp"
#include "shape.hpp"
#include "type.hpp"
#include "ngraph/common.hpp"
#include "ngraph/descriptor/input.hpp"
#include "ngraph/descriptor/output.hpp"
#include "ngraph/descriptor/tensor.hpp"
#include "ngraph/descriptor/tensor_view.hpp"
#include "ngraph/descriptor/tensor_view_layout.hpp"
#include "ngraph/element_type.hpp"
#include "ngraph/except.hpp"
#include "ngraph/function.hpp"
#include "ngraph/node.hpp"
#include "ngraph/op.hpp"
#include "ngraph/ops/add.hpp"
#include "ngraph/ops/broadcast.hpp"
#include "ngraph/ops/ceiling.hpp"
#include "ngraph/ops/concatenate.hpp"
#include "ngraph/ops/constant.hpp"
#include "ngraph/ops/convert.hpp"
#include "ngraph/ops/divide.hpp"
#include "ngraph/ops/dot.hpp"
#include "ngraph/ops/floor.hpp"
#include "ngraph/ops/multiply.hpp"
#include "ngraph/ops/parameter.hpp"
#include "ngraph/ops/subtract.hpp"
#include "ngraph/ops/tuple.hpp"
#include "ngraph/shape.hpp"
#include "ngraph/type.hpp"
......@@ -20,8 +20,8 @@
#include <iostream>
#include "common.hpp"
#include "type.hpp"
#include "ngraph/common.hpp"
#include "ngraph/type.hpp"
namespace ngraph
{
......@@ -69,7 +69,7 @@ namespace ngraph
const std::multiset<Node*>& users() const { return m_users; }
std::string get_name() const { return m_name; }
void set_name(const std::string& name) { m_name = name; }
void set_name(const std::string& name) { m_name = name; }
virtual std::string get_node_id() const = 0;
......@@ -106,17 +106,17 @@ namespace ngraph
size_t get_instance_id() const { return m_instance_id; }
friend std::ostream& operator<<(std::ostream&, const Node&);
std::vector<std::shared_ptr<descriptor::Input>> get_inputs() { return m_inputs; }
std::vector<std::shared_ptr<descriptor::Output>> get_outputs() {return m_outputs; }
std::vector<std::shared_ptr<descriptor::Input>> get_inputs() { return m_inputs; }
std::vector<std::shared_ptr<descriptor::Output>> get_outputs() { return m_outputs; }
protected:
Nodes m_arguments;
std::shared_ptr<ValueType> m_value_type;
std::multiset<Node*> m_users;
std::string m_name;
size_t m_instance_id;
static size_t m_next_instance_id;
std::vector<std::shared_ptr<descriptor::Input>> m_inputs;
Nodes m_arguments;
std::shared_ptr<ValueType> m_value_type;
std::multiset<Node*> m_users;
std::string m_name;
size_t m_instance_id;
static size_t m_next_instance_id;
std::vector<std::shared_ptr<descriptor::Input>> m_inputs;
std::vector<std::shared_ptr<descriptor::Output>> m_outputs;
};
}
......@@ -16,9 +16,9 @@
#include <memory>
#include "node.hpp"
#include "ops/parameter.hpp"
#include "type.hpp"
#include "ngraph/node.hpp"
#include "ngraph/ops/parameter.hpp"
#include "ngraph/type.hpp"
namespace ngraph
{
......@@ -97,7 +97,8 @@ namespace ngraph
class BinaryElementwiseBuiltin : public Builtin
{
protected:
BinaryElementwiseBuiltin(const std::shared_ptr<Node>& arg0, const std::shared_ptr<Node>& arg1)
BinaryElementwiseBuiltin(const std::shared_ptr<Node>& arg0,
const std::shared_ptr<Node>& arg1)
: Builtin(Nodes{arg0, arg1})
{
}
......
......@@ -16,7 +16,7 @@
#include <sstream>
#include "../element_type.hpp"
#include "ngraph/element_type.hpp"
namespace ngraph
{
......
......@@ -12,20 +12,20 @@
// See the License for the specific language governing permissions and
// ----------------------------------------------------------------------------
#include <unordered_map>
#include <deque>
#include <unordered_map>
#include "topological_sort.hpp"
#include "node.hpp"
#include "util.hpp"
#include "log.hpp"
#include "ngraph/node.hpp"
#include "ngraph/pass/topological_sort.hpp"
#include "util.hpp"
using namespace ngraph;
using namespace std;
bool ngraph::pass::TopologicalSort::run_on_tree(std::shared_ptr<Node> p)
{
deque<Node*> independent_nodes;
deque<Node*> independent_nodes;
unordered_map<Node*, size_t> node_depencency_count;
traverse_nodes(p, [&](Node* node) {
......
......@@ -14,10 +14,10 @@
#pragma once
#include <memory>
#include <list>
#include <memory>
#include "tree_pass.hpp"
#include "ngraph/pass/tree_pass.hpp"
namespace ngraph
{
......@@ -35,7 +35,7 @@ public:
bool run_on_tree(std::shared_ptr<Node>) override;
bool call_graph_produced() const override { return true; }
bool call_graph_produced() const override { return true; }
std::list<Node*> get_call_graph() const override;
private:
......
......@@ -13,7 +13,7 @@
// ----------------------------------------------------------------------------
#pragma once
#include <cstddef>
#include <vector>
namespace ngraph
......
......@@ -17,8 +17,8 @@
#include <memory>
#include <vector>
#include "element_type.hpp"
#include "shape.hpp"
#include "ngraph/element_type.hpp"
#include "ngraph/shape.hpp"
namespace ngraph
{
......@@ -33,10 +33,11 @@ namespace ngraph
public:
virtual ~ValueType() {}
virtual bool operator==(const ValueType& that) const = 0;
bool operator!=(const ValueType& that) const { return !(*this == that); }
bool operator!=(const ValueType& that) const { return !(*this == that); }
/// Add tensor views in depth-first order.
virtual void collect_tensor_views(std::vector<std::shared_ptr<const TensorViewType>>& views) const = 0;
virtual void collect_tensor_views(
std::vector<std::shared_ptr<const TensorViewType>>& views) const = 0;
friend std::ostream& operator<<(std::ostream&, const ValueType&);
};
......@@ -56,7 +57,8 @@ namespace ngraph
const Shape& get_shape() const { return m_shape; }
virtual bool operator==(const ValueType& that) const override;
virtual void collect_tensor_views(std::vector<std::shared_ptr<const TensorViewType>>& views) const override;
virtual void collect_tensor_views(
std::vector<std::shared_ptr<const TensorViewType>>& views) const override;
friend std::ostream& operator<<(std::ostream&, const TensorViewType&);
......@@ -85,7 +87,8 @@ namespace ngraph
std::vector<std::shared_ptr<ValueType>> set_element_types() { return m_element_types; }
virtual bool operator==(const ValueType& that) const override;
virtual void collect_tensor_views(std::vector<std::shared_ptr<const TensorViewType>>& views) const override;
virtual void collect_tensor_views(
std::vector<std::shared_ptr<const TensorViewType>>& views) const override;
friend std::ostream& operator<<(std::ostream&, const TupleType&);
protected:
......
......@@ -17,8 +17,8 @@
#include <list>
#include "ngraph/node.hpp"
#include "ngraph/visualize.hpp"
#include "util.hpp"
#include "visualize.hpp"
using namespace ngraph;
using namespace std;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment