Commit 09e88486 authored by Uros Petkovic's avatar Uros Petkovic
Browse files

Fix clang-format

parent ed196e59
......@@ -214,10 +214,13 @@ bool compare_literals(instruction_ref ins1, instruction_ref ins2)
l1.end(),
[&](auto v) {
return ((float_equal(v, l1.front())) or
(std::isinf(static_cast<double>(l1.front())) and std::isinf(static_cast<double>(v))));
(std::isinf(static_cast<double>(l1.front())) and
std::isinf(static_cast<double>(v))));
}) and
std::all_of(l2.begin(), l2.end(), [&](auto v) {
return ((float_equal(v, l1.front())) or (std::isinf(static_cast<double>(l1.front())) and std::isinf(static_cast<double>(v))));
return ((float_equal(v, l1.front())) or
(std::isinf(static_cast<double>(l1.front())) and
std::isinf(static_cast<double>(v))));
});
});
......
......@@ -39,11 +39,11 @@ using common_type = typename std::common_type<Ts...>::type;
template <class T, MIGRAPHX_REQUIRES(is_floating_point<T>{})>
__device__ bool float_equal_device(T x, T y)
{
// The standard library from MSVC does not implement std::isfinite() for integer
// types - no additional overloads are provided. According to the documentation,
// integer types should be treaded as doubles.
// Refer to https://en.cppreference.com/w/cpp/numeric/math/isfinite for more information.
return std::isfinite(static_cast<double>(x)) and std::isfinite(static_cast<double>(y)) and
// The standard library from MSVC does not implement std::isfinite() for integer
// types - no additional overloads are provided. According to the documentation,
// integer types should be treaded as doubles.
// Refer to https://en.cppreference.com/w/cpp/numeric/math/isfinite for more information.
return std::isfinite(static_cast<double>(x)) and std::isfinite(static_cast<double>(y)) and
std::nextafter(x, std::numeric_limits<T>::lowest()) <= y and
std::nextafter(x, std::numeric_limits<T>::max()) >= y;
}
......
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