| 28 | class FmaxSimpleTest : public ClientLibraryTestBase {}; |
| 29 | |
| 30 | XLA_TEST_F(FmaxSimpleTest, FmaxTenValues) { |
| 31 | SetFastMathDisabled(true); |
| 32 | XlaBuilder builder(TestName()); |
| 33 | auto x = ConstantR1<float>( |
| 34 | &builder, {-0.0, 1.0, 2.0, -3.0, -4.0, 5.0, 6.0, -7.0, -8.0, 9.0}); |
| 35 | auto y = ConstantR1<float>( |
| 36 | &builder, {-0.0, -1.0, -2.0, 3.0, 4.0, -5.0, -6.0, 7.0, 8.0, -9.0}); |
| 37 | Max(x, y); |
| 38 | |
| 39 | std::vector<float> expected = {-0.0, 1.0, 2.0, 3.0, 4.0, |
| 40 | 5.0, 6.0, 7.0, 8.0, 9.0}; |
| 41 | ComputeAndCompareR1<float>(&builder, expected, {}, ErrorSpec(0.0001)); |
| 42 | } |
| 43 | |
| 44 | XLA_TEST_F(FmaxSimpleTest, FmaxEdgeCases) { |
| 45 | SetFastMathDisabled(true); |