Commit d4b83ad4 authored by Paul's avatar Paul
Browse files

Format

parent 063ba0c4
...@@ -43,10 +43,11 @@ struct pointwise_compiler : compiler<pointwise_compiler> ...@@ -43,10 +43,11 @@ struct pointwise_compiler : compiler<pointwise_compiler>
static std::size_t oversubscribe(const std::vector<shape>& inputs) static std::size_t oversubscribe(const std::vector<shape>& inputs)
{ {
// if(std::any_of(inputs.begin(), inputs.end(), [](const auto& s) { return s.broadcasted(); })) // if(std::any_of(inputs.begin(), inputs.end(), [](const auto& s) { return s.broadcasted();
// }))
// return 1; // return 1;
// else // else
return 4; return 4;
} }
static std::size_t vectorize_elements(const std::vector<shape>& inputs) static std::size_t vectorize_elements(const std::vector<shape>& inputs)
{ {
......
...@@ -110,14 +110,14 @@ template <class... Shapes> ...@@ -110,14 +110,14 @@ template <class... Shapes>
constexpr index_int find_vector_axis_c(Shapes... ss) constexpr index_int find_vector_axis_c(Shapes... ss)
{ {
// const bool all_broadcasted = (ss.broadcasted() and ...); // const bool all_broadcasted = (ss.broadcasted() and ...);
index_int axis = 0; index_int axis = 0;
bool b = false; bool b = false;
by([&](auto s) { by([&](auto s) {
if(b) if(b)
return; return;
// Skip broadcasted shapes if there are shapes not broadcasted // Skip broadcasted shapes if there are shapes not broadcasted
// if(not all_broadcasted and s.broadcasted()) // if(not all_broadcasted and s.broadcasted())
// return; // return;
axis = find_vector_axis_c(s); axis = find_vector_axis_c(s);
if(s.strides[axis] == 1) if(s.strides[axis] == 1)
b = true; b = true;
...@@ -154,7 +154,7 @@ constexpr auto find_vectorize_size(P pred) ...@@ -154,7 +154,7 @@ constexpr auto find_vectorize_size(P pred)
{ {
// if constexpr(decltype(pred(_c<4>)){}) // if constexpr(decltype(pred(_c<4>)){})
// return _c<4>; // return _c<4>;
// else // else
if constexpr(decltype(pred(_c<2>)){}) if constexpr(decltype(pred(_c<2>)){})
return _c<2>; return _c<2>;
else else
......
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