diff options
author | 2018-08-24 08:26:45 -0700 | |
---|---|---|
committer | 2018-08-24 08:30:14 -0700 | |
commit | 187ed273038ccde054fa27bf19582b0cd8e5cb57 (patch) | |
tree | edc44e782d67d1b42fafd84a76737fb67082f75e /tensorflow/compiler/xla/tests | |
parent | 960a67023f086bc8ead87909e9f3e2e449a5172b (diff) |
[XLA] Add a 64-bit comparison test
PiperOrigin-RevId: 210101614
Diffstat (limited to 'tensorflow/compiler/xla/tests')
-rw-r--r-- | tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc b/tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc index 84c5b6e549..577fd1ab3b 100644 --- a/tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc +++ b/tensorflow/compiler/xla/tests/array_elementwise_ops_test.cc @@ -296,6 +296,22 @@ XLA_TEST_F(ArrayElementwiseOpTest, SubTwoConstantS64s) { ComputeAndCompareR1<int64>(&b, expected, {lhs_data.get(), rhs_data.get()}); } +XLA_TEST_F(ArrayElementwiseOpTest, CmpTwoConstantU64s) { + XlaBuilder b(TestName()); + + std::vector<uint64> lhs{static_cast<uint64>(0x8000000000000000ULL)}; + std::unique_ptr<Literal> lhs_literal = LiteralUtil::CreateR1<uint64>({lhs}); + auto lhs_param = Parameter(&b, 0, lhs_literal->shape(), "lhs_param"); + + std::vector<uint64> rhs{static_cast<uint64>(0x7FFFFFFFFFFFFFFFULL)}; + std::unique_ptr<Literal> rhs_literal = LiteralUtil::CreateR1<uint64>({rhs}); + auto rhs_param = Parameter(&b, 1, rhs_literal->shape(), "rhs_param"); + + Lt(lhs_param, rhs_param); + + ComputeAndCompare(&b, {std::move(*lhs_literal), std::move(*rhs_literal)}); +} + TEST_P(ArrayElementwiseOpTestParamCount, AddManyValues) { const int count = GetParam(); XlaBuilder builder(TestName()); |