Commit ab56a9eb authored by Paul's avatar Paul
Browse files

Formatting

parent eb0168fb
...@@ -28,14 +28,13 @@ inline namespace MIGRAPHX_INLINE_NS { ...@@ -28,14 +28,13 @@ inline namespace MIGRAPHX_INLINE_NS {
#define MIGRAPHX_DRIVER_STATIC static #define MIGRAPHX_DRIVER_STATIC static
#endif #endif
template<class T> template <class T>
using bare = std::remove_cv_t<std::remove_reference_t<T>>; using bare = std::remove_cv_t<std::remove_reference_t<T>>;
namespace detail { namespace detail {
template <class T> template <class T>
auto is_container(int, T&& x) auto is_container(int, T&& x) -> decltype(x.insert(x.end(), *x.begin()), std::true_type{});
-> decltype(x.insert(x.end(), *x.begin()), std::true_type{});
template <class T> template <class T>
std::false_type is_container(float, T&&); std::false_type is_container(float, T&&);
...@@ -49,8 +48,7 @@ struct is_container : decltype(detail::is_container(int(0), std::declval<T>())) ...@@ -49,8 +48,7 @@ struct is_container : decltype(detail::is_container(int(0), std::declval<T>()))
template <class T> template <class T>
using is_multi_value = using is_multi_value =
std::integral_constant<bool, std::integral_constant<bool, (is_container<T>{} and not std::is_convertible<T, std::string>{})>;
(is_container<T>{} and not std::is_convertible<T, std::string>{})>;
template <class T> template <class T>
struct value_parser struct value_parser
...@@ -102,13 +100,13 @@ struct argument_parser ...@@ -102,13 +100,13 @@ struct argument_parser
unsigned nargs = 1; unsigned nargs = 1;
}; };
template<class T, MIGRAPHX_REQUIRES(is_multi_value<T>{})> template <class T, MIGRAPHX_REQUIRES(is_multi_value<T>{})>
std::string as_string_value(const T& x) std::string as_string_value(const T& x)
{ {
return to_string_range(x); return to_string_range(x);
} }
template<class T, MIGRAPHX_REQUIRES(not is_multi_value<T>{})> template <class T, MIGRAPHX_REQUIRES(not is_multi_value<T>{})>
std::string as_string_value(const T& x) std::string as_string_value(const T& x)
{ {
return to_string(x); return to_string(x);
......
...@@ -97,10 +97,10 @@ struct compiler ...@@ -97,10 +97,10 @@ struct compiler
return p; return p;
} }
auto params(const program& p) auto params(const program& p)
{ {
program::parameter_map m; program::parameter_map m;
for(auto&& s:fill1) for(auto&& s : fill1)
m[s] = fill_argument(p.get_parameter_shape(s), 1); m[s] = fill_argument(p.get_parameter_shape(s), 1);
fill_param_map(m, p, gpu); fill_param_map(m, p, gpu);
return m; return m;
......
...@@ -16,7 +16,7 @@ program::parameter_map fill_param_map(program::parameter_map& m, const program& ...@@ -16,7 +16,7 @@ program::parameter_map fill_param_map(program::parameter_map& m, const program&
for(auto&& x : p.get_parameter_shapes()) for(auto&& x : p.get_parameter_shapes())
{ {
argument& arg = m[x.first]; argument& arg = m[x.first];
if (arg.empty()) if(arg.empty())
arg = generate_argument(x.second); arg = generate_argument(x.second);
#ifdef HAVE_GPU #ifdef HAVE_GPU
if(gpu) if(gpu)
......
...@@ -91,7 +91,7 @@ template <class T> ...@@ -91,7 +91,7 @@ template <class T>
std::vector<T> fill_tensor_data(const migraphx::shape& s, unsigned long value = 0) std::vector<T> fill_tensor_data(const migraphx::shape& s, unsigned long value = 0)
{ {
std::vector<T> result(s.elements()); std::vector<T> result(s.elements());
std::generate(result.begin(), result.end(), [=]{ return value; }); std::generate(result.begin(), result.end(), [=] { return value; });
return result; return result;
} }
......
...@@ -23,9 +23,10 @@ using bool_c = std::integral_constant<bool, B>; ...@@ -23,9 +23,10 @@ using bool_c = std::integral_constant<bool, B>;
#ifdef CPPCHECK #ifdef CPPCHECK
#define MIGRAPHX_REQUIRES(...) class = void #define MIGRAPHX_REQUIRES(...) class = void
#else #else
#define MIGRAPHX_REQUIRES(...) \ #define MIGRAPHX_REQUIRES(...) \
long MIGRAPHX_REQUIRES_VAR() = __LINE__, \ long MIGRAPHX_REQUIRES_VAR() = __LINE__, \
typename std::enable_if<(MIGRAPHX_REQUIRES_VAR() == __LINE__ && (migraphx::and_<__VA_ARGS__>{})), \ typename std::enable_if<(MIGRAPHX_REQUIRES_VAR() == __LINE__ && \
(migraphx::and_<__VA_ARGS__>{})), \
int>::type = 0 int>::type = 0
#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