Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Common/ML/include/ML/3rdparty/GPUORTFloat16.h
Original file line number Diff line number Diff line change
Expand Up @@ -568,9 +568,11 @@ GPUdi() uint16_t BFloat16Impl<Derived>::ToUint16Impl(float v) noexcept
template <class Derived>
GPUdi() float BFloat16Impl<Derived>::ToFloatImpl() const noexcept
{
#ifndef __FAST_MATH__
if (IsNaN()) {
return o2::gpu::CAMath::QuietNaN();
}
#endif
float result;
char* const first = reinterpret_cast<char*>(&result);
char* const second = first + sizeof(uint16_t);
Expand Down
7 changes: 2 additions & 5 deletions GPU/Common/GPUCommonMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,12 +99,9 @@ class GPUCommonMath
GPUhdi() static float Remainderf(float x, float y);
GPUd() constexpr static bool Finite(float x);
GPUd() constexpr static bool IsNaN(float x);
#pragma GCC diagnostic push
#if defined(__FAST_MATH__) && defined(__clang__)
#pragma GCC diagnostic ignored "-Wnan-infinity-disabled"
#endif
#ifndef __FAST_MATH__
GPUd() constexpr static float QuietNaN() { return GPUCA_CHOICE(std::numeric_limits<float>::quiet_NaN(), __builtin_nanf(""), nan(0u)); }
#pragma GCC diagnostic pop
#endif
GPUd() constexpr static uint32_t Clz(uint32_t val);
GPUd() constexpr static uint32_t Popcount(uint32_t val);

Expand Down