Commit a4026def authored by Shucai Xiao's avatar Shucai Xiao
Browse files

clang format for all changed files.

parent e1ef1e17
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#include <utility> #include <utility>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
struct swallow struct swallow
{ {
...@@ -130,7 +131,7 @@ auto fold(F f) ...@@ -130,7 +131,7 @@ auto fold(F f)
return [=](auto&&... xs) { return fold_impl(f, std::forward<decltype(xs)>(xs)...); }; return [=](auto&&... xs) { return fold_impl(f, std::forward<decltype(xs)>(xs)...); };
} }
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
#include <migraph/instruction_ref.hpp> #include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
struct program; struct program;
...@@ -15,7 +16,7 @@ struct fwd_conv_batchnorm_rewrite ...@@ -15,7 +16,7 @@ struct fwd_conv_batchnorm_rewrite
void apply(program& p) const; void apply(program& p) const;
}; };
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -7,7 +7,8 @@ ...@@ -7,7 +7,8 @@
#include <migraph/config.hpp> #include <migraph/config.hpp>
#include <random> #include <random>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
template <class T, MIGRAPH_REQUIRES(is_floating_point<T>{})> template <class T, MIGRAPH_REQUIRES(is_floating_point<T>{})>
constexpr T normalize(unsigned long z) constexpr T normalize(unsigned long z)
...@@ -92,7 +93,7 @@ literal generate_literal(shape s, unsigned long seed = 0); ...@@ -92,7 +93,7 @@ literal generate_literal(shape s, unsigned long seed = 0);
literal abs(literal l); literal abs(literal l);
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
#include <half.hpp> #include <half.hpp>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
using half = half_float::half; using half = half_float::half;
...@@ -32,7 +33,7 @@ struct deduce<half_float::detail::expr> ...@@ -32,7 +33,7 @@ struct deduce<half_float::detail::expr>
template <class T> template <class T>
using deduce = typename detail::deduce<T>::type; using deduce = typename detail::deduce<T>::type;
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
#include <string> #include <string>
#include <utility> #include <utility>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
shape compute_shape(const operation& op, const std::vector<instruction_ref>& args); shape compute_shape(const operation& op, const std::vector<instruction_ref>& args);
...@@ -89,7 +90,7 @@ struct instruction ...@@ -89,7 +90,7 @@ struct instruction
std::vector<instruction_ref> arguments; std::vector<instruction_ref> arguments;
literal lit; literal lit;
}; };
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
namespace std { namespace std {
......
...@@ -5,12 +5,13 @@ ...@@ -5,12 +5,13 @@
#include <functional> #include <functional>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
struct instruction; struct instruction;
using instruction_ref = std::list<instruction>::iterator; using instruction_ref = std::list<instruction>::iterator;
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
#include <type_traits> #include <type_traits>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
template <class T> template <class T>
struct iterator_for_range struct iterator_for_range
...@@ -38,7 +39,7 @@ iterator_for_range<T> iterator_for(T& x) ...@@ -38,7 +39,7 @@ iterator_for_range<T> iterator_for(T& x)
return {&x}; return {&x};
} }
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -11,7 +11,8 @@ ...@@ -11,7 +11,8 @@
#include <memory> #include <memory>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
/** /**
* @brief Represents a raw literal * @brief Represents a raw literal
...@@ -123,7 +124,7 @@ literal transform(literal l1, literal l2, F f) ...@@ -123,7 +124,7 @@ literal transform(literal l1, literal l2, F f)
return result; return result;
} }
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -4,7 +4,8 @@ ...@@ -4,7 +4,8 @@
#include <memory> #include <memory>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
template <typename T> template <typename T>
std::shared_ptr<T> make_shared_array(size_t size) std::shared_ptr<T> make_shared_array(size_t size)
...@@ -12,7 +13,7 @@ std::shared_ptr<T> make_shared_array(size_t size) ...@@ -12,7 +13,7 @@ std::shared_ptr<T> make_shared_array(size_t size)
return std::shared_ptr<T>(new T[size], std::default_delete<T[]>()); return std::shared_ptr<T>(new T[size], std::default_delete<T[]>());
} }
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
#include <type_traits> #include <type_traits>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
template <class F, F f> // NOLINT template <class F, F f> // NOLINT
struct manage_deleter struct manage_deleter
...@@ -50,7 +51,7 @@ shared<T> share(T p) ...@@ -50,7 +51,7 @@ shared<T> share(T p)
return shared<T>{std::move(p)}; return shared<T>{std::move(p)};
} }
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#define MIGRAPH_MANAGE_PTR(T, F) \ #define MIGRAPH_MANAGE_PTR(T, F) \
......
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
#include <migraph/config.hpp> #include <migraph/config.hpp>
#include <unordered_map> #include <unordered_map>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace match { namespace match {
...@@ -339,7 +340,7 @@ inline auto either_arg(std::size_t i, std::size_t j) ...@@ -339,7 +340,7 @@ inline auto either_arg(std::size_t i, std::size_t j)
} }
} // namespace match } // namespace match
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -5,7 +5,8 @@ ...@@ -5,7 +5,8 @@
#include <migraph/instruction_ref.hpp> #include <migraph/instruction_ref.hpp>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
struct program; struct program;
struct memory_coloring struct memory_coloring
...@@ -15,7 +16,7 @@ struct memory_coloring ...@@ -15,7 +16,7 @@ struct memory_coloring
void apply(program& p) const; void apply(program& p) const;
}; };
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -4,12 +4,13 @@ ...@@ -4,12 +4,13 @@
#include <migraph/program.hpp> #include <migraph/program.hpp>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
/// Create a program from an onnx file /// Create a program from an onnx file
program parse_onnx(const std::string& name); program parse_onnx(const std::string& name);
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -15,7 +15,8 @@ ...@@ -15,7 +15,8 @@
#include <migraph/auto_any_cast.hpp> #include <migraph/auto_any_cast.hpp>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
#ifdef DOXYGEN #ifdef DOXYGEN
......
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
#include <cmath> #include <cmath>
#include <utility> #include <utility>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace op { namespace op {
struct not_computable struct not_computable
...@@ -853,7 +854,7 @@ struct outline ...@@ -853,7 +854,7 @@ struct outline
}; };
} // namespace op } // namespace op
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -9,7 +9,8 @@ ...@@ -9,7 +9,8 @@
#include <utility> #include <utility>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
struct program; struct program;
...@@ -217,7 +218,7 @@ inline const ValueType& any_cast(const pass& x) ...@@ -217,7 +218,7 @@ inline const ValueType& any_cast(const pass& x)
#endif #endif
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -5,10 +5,11 @@ ...@@ -5,10 +5,11 @@
#include <migraph/env.hpp> #include <migraph/env.hpp>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_DISABLE_MEMORY_COLORING) MIGRAPH_DECLARE_ENV_VAR(MIGRAPH_DISABLE_MEMORY_COLORING)
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif // MIGRAPH_GUARD_PASS_CONFIG_HPP #endif // MIGRAPH_GUARD_PASS_CONFIG_HPP
...@@ -13,7 +13,8 @@ ...@@ -13,7 +13,8 @@
#include <algorithm> #include <algorithm>
#include <iostream> #include <iostream>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
struct program_impl; struct program_impl;
...@@ -108,7 +109,7 @@ struct program ...@@ -108,7 +109,7 @@ struct program
std::unique_ptr<program_impl> impl; std::unique_ptr<program_impl> impl;
}; };
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -6,7 +6,8 @@ ...@@ -6,7 +6,8 @@
#include <migraph/rank.hpp> #include <migraph/rank.hpp>
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
namespace detail { namespace detail {
...@@ -105,7 +106,7 @@ iterator_range<Iterator> range(std::pair<Iterator, Iterator> p) ...@@ -105,7 +106,7 @@ iterator_range<Iterator> range(std::pair<Iterator, Iterator> p)
return {p.first, p.second}; return {p.first, p.second};
} }
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
...@@ -3,7 +3,8 @@ ...@@ -3,7 +3,8 @@
#include <migraph/config.hpp> #include <migraph/config.hpp>
namespace migraph { inline namespace MIGRAPH_INLINE_NS { namespace migraph {
inline namespace MIGRAPH_INLINE_NS {
template <int N> template <int N>
struct rank : rank<N - 1> struct rank : rank<N - 1>
...@@ -15,7 +16,7 @@ struct rank<0> ...@@ -15,7 +16,7 @@ struct rank<0>
{ {
}; };
} // inline namespace MIGRAPH_INLINE_NS } // namespace MIGRAPH_INLINE_NS
} // namespace migraph } // namespace migraph
#endif #endif
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