Skip to content

Commit

Permalink
WIP: try fix the compilation issue from MSVC and MacOS
Browse files Browse the repository at this point in the history
  • Loading branch information
yhmtsai committed Feb 6, 2023
1 parent 3afd5f0 commit a141380
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions core/base/extended_float.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -753,6 +753,9 @@ struct numeric_limits<gko::half> {
{
return numeric_limits<float>::quiet_NaN();
}

// For MacOS
static constexpr bool has_infinity{true};
};

// complex using a template on operator= for any kind of complex<T>, so we can
Expand All @@ -766,6 +769,19 @@ inline complex<double>& complex<double>::operator=(
return *this;
}

// For MSVC
template <>
inline complex<float>& complex<float>::operator=(
const std::complex<gko::half>& a)
{
complex<float> t(a.real(), a.imag());
operator=(t);
return *this;
}

inline bool isfinite(gko::half t) { return isfinite(static_cast<float>(t)); }


} // namespace std


Expand Down

0 comments on commit a141380

Please sign in to comment.