Commit a138509b authored by Bob Kimball's avatar Bob Kimball

clang-format-3.9 style

parent 22e2307b
...@@ -43,10 +43,10 @@ public: ...@@ -43,10 +43,10 @@ public:
private: private:
static std::map<std::string, ElementType> m_element_list; static std::map<std::string, ElementType> m_element_list;
size_t m_bitwidth; size_t m_bitwidth;
bool m_is_float; bool m_is_float;
bool m_is_signed; bool m_is_signed;
const std::string m_cname; const std::string m_cname;
}; };
extern const ngraph::ElementType element_type_float; extern const ngraph::ElementType element_type_float;
......
...@@ -36,8 +36,7 @@ namespace nervana ...@@ -36,8 +36,7 @@ namespace nervana
return i < _size ? _string[i] : throw std::out_of_range(""); return i < _size ? _string[i] : throw std::out_of_range("");
} }
constexpr const char* get_ptr(size_t offset) const { return &_string[offset]; } constexpr const char* get_ptr(size_t offset) const { return &_string[offset]; }
constexpr size_t size() const { return _size; } constexpr size_t size() const { return _size; }
private: private:
const char* _string; const char* _string;
size_t _size; size_t _size;
...@@ -45,9 +44,8 @@ namespace nervana ...@@ -45,9 +44,8 @@ namespace nervana
constexpr const char* find_last(conststring s, size_t offset, char ch) constexpr const char* find_last(conststring s, size_t offset, char ch)
{ {
return offset == 0 return offset == 0 ? s.get_ptr(0) : (s[offset] == ch ? s.get_ptr(offset + 1)
? s.get_ptr(0) : find_last(s, offset - 1, ch));
: (s[offset] == ch ? s.get_ptr(offset + 1) : find_last(s, offset - 1, ch));
} }
constexpr const char* find_last(conststring s, char ch) constexpr const char* find_last(conststring s, char ch)
...@@ -69,7 +67,6 @@ namespace nervana ...@@ -69,7 +67,6 @@ namespace nervana
~log_helper(); ~log_helper();
std::ostream& stream() { return _stream; } std::ostream& stream() { return _stream; }
private: private:
std::stringstream _stream; std::stringstream _stream;
}; };
...@@ -84,9 +81,9 @@ namespace nervana ...@@ -84,9 +81,9 @@ namespace nervana
static void stop(); static void stop();
private: private:
static void log_item(const std::string& s); static void log_item(const std::string& s);
static void process_event(const std::string& s); static void process_event(const std::string& s);
static void thread_entry(void* param); static void thread_entry(void* param);
static std::string log_path; static std::string log_path;
static std::deque<std::string> queue; static std::deque<std::string> queue;
}; };
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
using namespace ngraph; using namespace ngraph;
size_t NameableValue::__counter = 0; size_t NameableValue::__counter = 0;
std::map<std::string, NameableValue> NameableValue::__all_names; std::map<std::string, NameableValue> NameableValue::__all_names;
NameableValue::NameableValue(const std::string& name, NameableValue::NameableValue(const std::string& name,
......
...@@ -95,7 +95,7 @@ namespace ngraph ...@@ -95,7 +95,7 @@ namespace ngraph
//!----------------------------------------------------------------------------------- //!-----------------------------------------------------------------------------------
NameableValue& named(const std::string& name); NameableValue& named(const std::string& name);
static size_t __counter; static size_t __counter;
static std::map<std::string, NameableValue> __all_names; static std::map<std::string, NameableValue> __all_names;
std::string m_name; std::string m_name;
......
...@@ -27,10 +27,9 @@ public: ...@@ -27,10 +27,9 @@ public:
ElementType et = element_type_float); ElementType et = element_type_float);
const ElementType& get_type() const { return m_element_type; } const ElementType& get_type() const { return m_element_type; }
tensor_stride full_strides() const;
tensor_stride full_strides() const; tensor_stride strides() const;
tensor_stride strides() const; tensor_size sizes() const;
tensor_size sizes() const;
tensor_size operator[](size_t index) const; tensor_size operator[](size_t index) const;
...@@ -53,9 +52,8 @@ class ngraph::tensor_stride ...@@ -53,9 +52,8 @@ class ngraph::tensor_stride
public: public:
tensor_stride(); tensor_stride();
const ElementType& get_type() const { return m_element_type; } const ElementType& get_type() const { return m_element_type; }
tensor_stride full_strides() const;
tensor_stride full_strides() const; tensor_stride strides() const;
tensor_stride strides() const;
tensor_stride reduce_strides() const; tensor_stride reduce_strides() const;
......
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include <cassert>
#include <cmath>
#include <iostream> #include <iostream>
#include <sstream> #include <sstream>
#include <cmath>
#include <cassert>
#include "axes.hpp" #include "axes.hpp"
#include "util.hpp" #include "util.hpp"
...@@ -268,7 +268,7 @@ Axis ngraph::slice_axis(const Axis& axis, const slice& s) ...@@ -268,7 +268,7 @@ Axis ngraph::slice_axis(const Axis& axis, const slice& s)
std::vector<std::string> ngraph::duplicates(const std::vector<Axis>& ax) std::vector<std::string> ngraph::duplicates(const std::vector<Axis>& ax)
{ {
std::map<std::string, size_t> counts; std::map<std::string, size_t> counts;
std::vector<std::string> rc; std::vector<std::string> rc;
for (const Axis& axis : ax) for (const Axis& axis : ax)
{ {
auto it = counts.find(axis.name); auto it = counts.find(axis.name);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -12,10 +12,10 @@ ...@@ -12,10 +12,10 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
#include <cmath>
#include <exception>
#include <memory> #include <memory>
#include <sstream> #include <sstream>
#include <exception>
#include <cmath>
#include "exop.hpp" #include "exop.hpp"
#include "op_graph.hpp" #include "op_graph.hpp"
...@@ -404,10 +404,10 @@ void ExOpBlock::add_ops(std::initializer_list<computation_op_ptr> roots, exop_pt ...@@ -404,10 +404,10 @@ void ExOpBlock::add_ops(std::initializer_list<computation_op_ptr> roots, exop_pt
} }
} }
std::vector<op_ptr> available; std::vector<op_ptr> available;
std::map<op_ptr, size_t> counts; std::map<op_ptr, size_t> counts;
std::map<op_ptr, std::vector<op_ptr>> parents; std::map<op_ptr, std::vector<op_ptr>> parents;
std::vector<op_ptr> ready; std::vector<op_ptr> ready;
available.insert(available.end(), roots.begin(), roots.end()); available.insert(available.end(), roots.begin(), roots.end());
while (available.size() > 0) while (available.size() > 0)
...@@ -1012,7 +1012,7 @@ tensor_decl_ptr ExecutionState::ensure_tensor_decl(ExecutionGraph& execut ...@@ -1012,7 +1012,7 @@ tensor_decl_ptr ExecutionState::ensure_tensor_decl(ExecutionGraph& execut
bool is_constant = false; bool is_constant = false;
bool is_compile_only = false; bool is_compile_only = false;
tensor_decl = std::make_shared<TensorDecl>(execution_graph, tensor_decl = std::make_shared<TensorDecl>(execution_graph,
tensor_description_base->element_type(), tensor_description_base->element_type(),
tensor_description_base->tensor_size(), tensor_description_base->tensor_size(),
tensor_description_base->is_persistent(), tensor_description_base->is_persistent(),
...@@ -1057,7 +1057,7 @@ tensor_decl_ptr ExecutionGraph::get_tensor_decl(op_ptr op, ...@@ -1057,7 +1057,7 @@ tensor_decl_ptr ExecutionGraph::get_tensor_decl(op_ptr op,
bool is_constant = false; bool is_constant = false;
bool is_compile_only = false; bool is_compile_only = false;
tensor_decl = std::make_shared<TensorDecl>(*this, tensor_decl = std::make_shared<TensorDecl>(*this,
tensor_description_base->element_type(), tensor_description_base->element_type(),
tensor_description_base->tensor_size(), tensor_description_base->tensor_size(),
tensor_description_base->is_persistent(), tensor_description_base->is_persistent(),
......
This diff is collapsed.
This diff is collapsed.
...@@ -14,24 +14,21 @@ ...@@ -14,24 +14,21 @@
#pragma once #pragma once
#include "mock.hpp"
#include "exop.hpp" #include "exop.hpp"
#include "mock.hpp"
namespace ngraph namespace ngraph
{ {
//================================================================================================
//================================================================================================ // CpuTransformer
// CpuTransformer //================================================================================================
//================================================================================================ class CpuTransformer : public Transformer
class CpuTransformer : public Transformer {
{ public:
public: virtual ~CpuTransformer() {}
virtual ~CpuTransformer() {} ExecutionState& execution_state() override { return m_execution_state; }
private:
ExecutionState& execution_state() override { return m_execution_state; } ExecutionState m_execution_state;
};
private:
ExecutionState m_execution_state;
};
} // end namespace ngraph } // end namespace ngraph
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#pragma once #pragma once
#include <vector>
#include <memory> #include <memory>
#include <vector>
#include "element_type.hpp" #include "element_type.hpp"
#include "strides.hpp" #include "strides.hpp"
......
...@@ -14,8 +14,8 @@ ...@@ -14,8 +14,8 @@
#include <sstream> #include <sstream>
#include "op_graph.hpp"
#include "axes.hpp" #include "axes.hpp"
#include "op_graph.hpp"
#include "util.hpp" #include "util.hpp"
using namespace ngraph; using namespace ngraph;
...@@ -2794,7 +2794,9 @@ ElementWiseOp::ElementWiseOp() ...@@ -2794,7 +2794,9 @@ ElementWiseOp::ElementWiseOp()
{ {
} }
void ElementWiseOp::ElementWiseOp_init(std::vector<op_ptr>, Axes) {} void ElementWiseOp::ElementWiseOp_init(std::vector<op_ptr>, Axes)
{
}
//================================================================================================ //================================================================================================
// UnaryElementWiseOp // UnaryElementWiseOp
......
This diff is collapsed.
...@@ -51,7 +51,6 @@ public: ...@@ -51,7 +51,6 @@ public:
bool is_list() const { return m_is_list; } bool is_list() const { return m_is_list; }
T get_value() const { return m_value; } T get_value() const { return m_value; }
const std::vector<tree>& get_list() const { return m_list; } const std::vector<tree>& get_list() const { return m_list; }
static void traverse_tree(tree& s, std::function<void(T*)> func) static void traverse_tree(tree& s, std::function<void(T*)> func)
{ {
if (s.is_list()) if (s.is_list())
......
...@@ -83,10 +83,10 @@ namespace ngraph ...@@ -83,10 +83,10 @@ namespace ngraph
} }
size_t hash_combine(const std::vector<size_t>& list); size_t hash_combine(const std::vector<size_t>& list);
void dump(std::ostream& out, const void*, size_t); void dump(std::ostream& out, const void*, size_t);
std::string to_lower(const std::string& s); std::string to_lower(const std::string& s);
std::string trim(const std::string& s); std::string trim(const std::string& s);
std::vector<std::string> split(const std::string& s, char delimiter, bool trim = false); std::vector<std::string> split(const std::string& s, char delimiter, bool trim = false);
class stopwatch class stopwatch
...@@ -148,7 +148,6 @@ namespace ngraph ...@@ -148,7 +148,6 @@ namespace ngraph
size_t get_total_milliseconds() const { return get_total_nanoseconds() / 1e6; } size_t get_total_milliseconds() const { return get_total_nanoseconds() / 1e6; }
size_t get_total_microseconds() const { return get_total_nanoseconds() / 1e3; } size_t get_total_microseconds() const { return get_total_nanoseconds() / 1e3; }
size_t get_total_nanoseconds() const { return m_total_time.count(); } size_t get_total_nanoseconds() const { return m_total_time.count(); }
private: private:
std::chrono::high_resolution_clock m_clock; std::chrono::high_resolution_clock m_clock;
std::chrono::time_point<std::chrono::high_resolution_clock> m_start_time; std::chrono::time_point<std::chrono::high_resolution_clock> m_start_time;
......
...@@ -74,7 +74,6 @@ public: ...@@ -74,7 +74,6 @@ public:
} }
bool operator!=(const uuid_type& other) const { return !(*this == other); } bool operator!=(const uuid_type& other) const { return !(*this == other); }
friend std::ostream& operator<<(std::ostream& out, const uuid_type& id) friend std::ostream& operator<<(std::ostream& out, const uuid_type& id)
{ {
out << id.to_string(); out << id.to_string();
......
...@@ -22,4 +22,6 @@ ...@@ -22,4 +22,6 @@
using namespace ngraph; using namespace ngraph;
TEST(names, name) {} TEST(names, name)
{
}
...@@ -134,7 +134,9 @@ TEST(util, contains) ...@@ -134,7 +134,9 @@ TEST(util, contains)
EXPECT_FALSE(contains(v1, 8)); EXPECT_FALSE(contains(v1, 8));
} }
TEST(util, remove_from) {} TEST(util, remove_from)
{
}
TEST(util, reduce) TEST(util, reduce)
{ {
......
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