Commit 5260cecb authored by Nick Desaulniers's avatar Nick Desaulniers Committed by Michael Case
Browse files

[XLA] Initialize linear indices used by NearComparator.

In unoptimized builds, we'd see miscompares with insanely large indices when
comparing literals containing NaN.

The linear indices may never be updated/initialized if the value NaN was
compared, since:

(NaN > x) == false
(NaN < x) == false

Adds a few tests that were used when debugging, but not a perfect one for this
case. It's currently not possible to test that LiteralTestUtil::Near() fails
when given bad input since it uses the EXPECT_* family of macros, which would
cause the intentional miscompares to fail the test no matter what.

PiperOrigin-RevId: 184048275
parent b47b2a7f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment