Commit b164085d authored by Jö Fahlke's avatar Jö Fahlke

Implement binary min()/max().

See: core/dune-common!620
parent 79eabaf7
Pipeline #16230 failed with stage
in 5 minutes and 44 seconds
......@@ -273,6 +273,20 @@ namespace Dune {
return (mask & ifTrue) | ((!mask) & ifFalse);
}
template<class Vec>
auto max(ADLTag<5, VectorclassImpl::IsVector<Vec>::value>,
Vec v1, Vec v2)
{
return Simd::cond(v1 < v2, v2, v1);
}
template<class Vec>
auto min(ADLTag<5, VectorclassImpl::IsVector<Vec>::value>,
Vec v1, Vec v2)
{
return Simd::cond(v1 < v2, v1, v2);
}
template<class M, typename = std::enable_if_t<VectorclassImpl::IsMask<M>::value>>
bool anyTrue(ADLTag<5>, M mask) {
return horizontal_or(mask);
......
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