Commit d36f72c5 authored by Paul's avatar Paul
Browse files

Format

parent 8b5b6758
...@@ -68,13 +68,13 @@ namespace migraphx { ...@@ -68,13 +68,13 @@ namespace migraphx {
return z; \ return z; \
} }
template<class T> template <class T>
constexpr auto is_vectorizable() constexpr auto is_vectorizable()
{ {
return not is_same<T, bool>{} and (is_fundamental<T>{} or is_same<T, half>{}); return not is_same<T, bool>{} and (is_fundamental<T>{} or is_same<T, half>{});
} }
template<class T> template <class T>
constexpr auto array2vec(T x) constexpr auto array2vec(T x)
{ {
using value_type = typename T::value_type; using value_type = typename T::value_type;
...@@ -84,7 +84,7 @@ constexpr auto array2vec(T x) ...@@ -84,7 +84,7 @@ constexpr auto array2vec(T x)
return __builtin_bit_cast(type, x); return __builtin_bit_cast(type, x);
} }
template<class T, class U, index_int N> template <class T, class U, index_int N>
constexpr void vec2array(T& x, vec<U, N> v) constexpr void vec2array(T& x, vec<U, N> v)
{ {
if constexpr(not is_const<T>{}) if constexpr(not is_const<T>{})
...@@ -97,7 +97,8 @@ constexpr auto array_for_each(T& x, Ts&... xs) ...@@ -97,7 +97,8 @@ constexpr auto array_for_each(T& x, Ts&... xs)
MIGRAPHX_ASSERT((x.size() == xs.size() and ...)); MIGRAPHX_ASSERT((x.size() == xs.size() and ...));
return [&](auto f) { return [&](auto f) {
constexpr auto size = decltype(x.size()){}; constexpr auto size = decltype(x.size()){};
if constexpr((is_vectorizable<typename T::value_type>() or (is_vectorizable<typename Ts::value_type>() or ...)) and if constexpr((is_vectorizable<typename T::value_type>() or
(is_vectorizable<typename Ts::value_type>() or ...)) and
size <= 8 and size > 1 and (size % 2 == 0)) size <= 8 and size > 1 and (size % 2 == 0))
{ {
[&](auto v, auto... vs) { [&](auto v, auto... vs) {
......
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