Commit 11fcecad authored by Paul's avatar Paul
Browse files

Formatting

parent 0b217041
...@@ -47,7 +47,7 @@ struct check_shapes ...@@ -47,7 +47,7 @@ struct check_shapes
{ {
if(size() != n) if(size() != n)
MIGRAPHX_THROW(prefix() + "Wrong number of arguments: expected " + std::to_string(n) + MIGRAPHX_THROW(prefix() + "Wrong number of arguments: expected " + std::to_string(n) +
" but given " + std::to_string(size())); " but given " + std::to_string(size()));
return *this; return *this;
} }
......
...@@ -9,7 +9,7 @@ namespace migraphx { ...@@ -9,7 +9,7 @@ namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
// Declare a cached environment variable // Declare a cached environment variable
#define MIGRAPHX_DECLARE_ENV_VAR(x) \ #define MIGRAPHX_DECLARE_ENV_VAR(x) \
struct x \ struct x \
{ \ { \
static const char* value() { return #x; } \ static const char* value() { return #x; } \
......
...@@ -169,7 +169,7 @@ basic_matcher<predicate_matcher<P>> make_basic_pred_matcher(P p) ...@@ -169,7 +169,7 @@ basic_matcher<predicate_matcher<P>> make_basic_pred_matcher(P p)
} }
/// This macro takes care of the boilerplate for defining a matcher /// This macro takes care of the boilerplate for defining a matcher
#define MIGRAPHX_BASIC_MATCHER(name, ...) \ #define MIGRAPHX_BASIC_MATCHER(name, ...) \
struct name##_m \ struct name##_m \
{ \ { \
instruction_ref match(__VA_ARGS__) const; \ instruction_ref match(__VA_ARGS__) const; \
...@@ -178,7 +178,7 @@ basic_matcher<predicate_matcher<P>> make_basic_pred_matcher(P p) ...@@ -178,7 +178,7 @@ basic_matcher<predicate_matcher<P>> make_basic_pred_matcher(P p)
inline instruction_ref name##_m::match(__VA_ARGS__) const inline instruction_ref name##_m::match(__VA_ARGS__) const
/// This macro takes care of the boilerplate for defining a predicate matcher /// This macro takes care of the boilerplate for defining a predicate matcher
#define MIGRAPHX_PRED_MATCHER(name, ...) \ #define MIGRAPHX_PRED_MATCHER(name, ...) \
struct name##_m \ struct name##_m \
{ \ { \
bool operator()(__VA_ARGS__) const; \ bool operator()(__VA_ARGS__) const; \
......
...@@ -590,8 +590,8 @@ struct dot ...@@ -590,8 +590,8 @@ struct dot
auto t = a.type(); auto t = a.type();
if(a.lens()[1] != b.lens()[0]) if(a.lens()[1] != b.lens()[0])
MIGRAPHX_THROW("Inner dimensions do not match: {" + to_string_range(a.lens()) + "} x {" + MIGRAPHX_THROW("Inner dimensions do not match: {" + to_string_range(a.lens()) +
to_string_range(b.lens()) + "}"); "} x {" + to_string_range(b.lens()) + "}");
return {t, {a.lens()[0], b.lens()[1]}}; return {t, {a.lens()[0], b.lens()[1]}};
} }
}; };
......
...@@ -144,7 +144,7 @@ struct raw_data : raw_data_base ...@@ -144,7 +144,7 @@ struct raw_data : raw_data_base
template <class T, template <class T,
class U, class U,
MIGRAPHX_REQUIRES(std::is_base_of<raw_data_base, T>{} && MIGRAPHX_REQUIRES(std::is_base_of<raw_data_base, T>{} &&
std::is_base_of<raw_data_base, U>{})> std::is_base_of<raw_data_base, U>{})>
bool operator==(const T& x, const U& y) bool operator==(const T& x, const U& y)
{ {
auto&& xshape = x.get_shape(); auto&& xshape = x.get_shape();
...@@ -167,7 +167,7 @@ bool operator==(const T& x, const U& y) ...@@ -167,7 +167,7 @@ bool operator==(const T& x, const U& y)
template <class T, template <class T,
class U, class U,
MIGRAPHX_REQUIRES(std::is_base_of<raw_data_base, T>{} && MIGRAPHX_REQUIRES(std::is_base_of<raw_data_base, T>{} &&
std::is_base_of<raw_data_base, U>{})> std::is_base_of<raw_data_base, U>{})>
bool operator!=(const T& x, const U& y) bool operator!=(const T& x, const U& y)
{ {
return !(x == y); return !(x == y);
......
...@@ -33,14 +33,14 @@ struct requires_enum ...@@ -33,14 +33,14 @@ struct requires_enum
// TODO: This currently crashed on clang // TODO: This currently crashed on clang
#define MIGRAPHX_REQUIRES(...) \ #define MIGRAPHX_REQUIRES(...) \
typename migraphx::requires_enum<__LINE__>::e MIGRAPHX_REQUIRES_CAT( \ typename migraphx::requires_enum<__LINE__>::e MIGRAPHX_REQUIRES_CAT( \
PrivateRequires, \ PrivateRequires, \
__LINE__) = migraphx::requires_enum<__LINE__>::a, \ __LINE__) = migraphx::requires_enum<__LINE__>::a, \
class = typename std::enable_if<and_<__VA_ARGS__, \ class = typename std::enable_if<and_<__VA_ARGS__, \
MIGRAPHX_REQUIRES_CAT(PrivateRequires, __LINE__) == \ MIGRAPHX_REQUIRES_CAT(PrivateRequires, __LINE__) == \
migraphx::requires_enum<__LINE__>::a>{}>::type migraphx::requires_enum<__LINE__>::a>{}>::type
#else #else
#define MIGRAPHX_REQUIRES(...) \ #define MIGRAPHX_REQUIRES(...) \
typename migraphx::requires_enum<__LINE__>::e MIGRAPHX_REQUIRES_CAT( \ typename migraphx::requires_enum<__LINE__>::e MIGRAPHX_REQUIRES_CAT( \
PrivateRequires, __LINE__) = migraphx::requires_enum<__LINE__>::a, \ PrivateRequires, __LINE__) = migraphx::requires_enum<__LINE__>::a, \
class = typename std::enable_if<and_<__VA_ARGS__>{}>::type class = typename std::enable_if<and_<__VA_ARGS__>{}>::type
#endif #endif
......
...@@ -44,7 +44,7 @@ struct shape ...@@ -44,7 +44,7 @@ struct shape
template <class T, class = void> template <class T, class = void>
struct get_type; struct get_type;
#define MIGRAPHX_SHAPE_GET_TYPE(x, t) \ #define MIGRAPHX_SHAPE_GET_TYPE(x, t) \
template <class T> \ template <class T> \
struct get_type<t, T> : std::integral_constant<type_t, x> \ struct get_type<t, T> : std::integral_constant<type_t, x> \
{ \ { \
......
...@@ -16,14 +16,14 @@ namespace migraphx { ...@@ -16,14 +16,14 @@ namespace migraphx {
inline namespace MIGRAPHX_INLINE_NS { inline namespace MIGRAPHX_INLINE_NS {
#define MIGRAPHX_DETAIL_EXTEND_TRAIT_FOR(trait, T) \ #define MIGRAPHX_DETAIL_EXTEND_TRAIT_FOR(trait, T) \
template <class X> \ template <class X> \
struct trait : std::trait<X> \ struct trait : std::trait<X> \
{ \ { \
}; \ }; \
\ \
template <> \ template <> \
struct trait<T> : std::true_type \ struct trait<T> : std::true_type \
{ \ { \
}; };
MIGRAPHX_DETAIL_EXTEND_TRAIT_FOR(is_floating_point, half) MIGRAPHX_DETAIL_EXTEND_TRAIT_FOR(is_floating_point, half)
......
...@@ -298,7 +298,7 @@ void program::compile(const target& t, tracer trace) ...@@ -298,7 +298,7 @@ void program::compile(const target& t, tracer trace)
{ {
auto index = std::distance(impl->instructions.begin(), invalid); auto index = std::distance(impl->instructions.begin(), invalid);
MIGRAPHX_THROW(p.name() + " pass produces invalid program at instruction " + MIGRAPHX_THROW(p.name() + " pass produces invalid program at instruction " +
std::to_string(index) + ": " + invalid->name()); std::to_string(index) + ": " + invalid->name());
} }
trace(); trace();
#endif #endif
......
...@@ -12,15 +12,15 @@ namespace gpu { ...@@ -12,15 +12,15 @@ namespace gpu {
using miopen_handle = MIGRAPHX_MANAGE_PTR(miopenHandle_t, miopenDestroy); using miopen_handle = MIGRAPHX_MANAGE_PTR(miopenHandle_t, miopenDestroy);
using tensor_descriptor = MIGRAPHX_MANAGE_PTR(miopenTensorDescriptor_t, using tensor_descriptor = MIGRAPHX_MANAGE_PTR(miopenTensorDescriptor_t,
miopenDestroyTensorDescriptor); miopenDestroyTensorDescriptor);
using convolution_descriptor = MIGRAPHX_MANAGE_PTR(miopenConvolutionDescriptor_t, using convolution_descriptor = MIGRAPHX_MANAGE_PTR(miopenConvolutionDescriptor_t,
miopenDestroyConvolutionDescriptor); miopenDestroyConvolutionDescriptor);
using pooling_descriptor = MIGRAPHX_MANAGE_PTR(miopenPoolingDescriptor_t, using pooling_descriptor = MIGRAPHX_MANAGE_PTR(miopenPoolingDescriptor_t,
miopenDestroyPoolingDescriptor); miopenDestroyPoolingDescriptor);
using activation_descriptor = MIGRAPHX_MANAGE_PTR(miopenActivationDescriptor_t, using activation_descriptor = MIGRAPHX_MANAGE_PTR(miopenActivationDescriptor_t,
miopenDestroyActivationDescriptor); miopenDestroyActivationDescriptor);
using fusion_plan_descriptor = MIGRAPHX_MANAGE_PTR(miopenFusionPlanDescriptor_t, using fusion_plan_descriptor = MIGRAPHX_MANAGE_PTR(miopenFusionPlanDescriptor_t,
miopenDestroyFusionPlan); miopenDestroyFusionPlan);
using fused_operator_args = MIGRAPHX_MANAGE_PTR(miopenOperatorArgs_t, miopenDestroyOperatorArgs); using fused_operator_args = MIGRAPHX_MANAGE_PTR(miopenOperatorArgs_t, miopenDestroyOperatorArgs);
template <class Result, class F, class... Ts> template <class Result, class F, class... Ts>
......
...@@ -30,7 +30,7 @@ struct mem_data_ptr ...@@ -30,7 +30,7 @@ struct mem_data_ptr
using type = T C::*; using type = T C::*;
}; };
#define MIGRAPHX_ROB(name, Type, C, mem) \ #define MIGRAPHX_ROB(name, Type, C, mem) \
struct name##_tag : mem_data_ptr<C, Type> \ struct name##_tag : mem_data_ptr<C, Type> \
{ \ { \
}; \ }; \
......
...@@ -40,9 +40,9 @@ TEST_CASE(incomplete_args) ...@@ -40,9 +40,9 @@ TEST_CASE(incomplete_args)
} }
MIGRAPHX_ROB(access_ins_arguments, MIGRAPHX_ROB(access_ins_arguments,
std::vector<migraphx::instruction_ref>, std::vector<migraphx::instruction_ref>,
migraphx::instruction, migraphx::instruction,
arguments) arguments)
TEST_CASE(invalid_args) TEST_CASE(invalid_args)
{ {
......
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