| 91 | } |
| 92 | |
| 93 | XLA_TEST_F(DeallocationTest, DeallocateTuple) { |
| 94 | XlaBuilder builder(TestName()); |
| 95 | Tuple(&builder, {ConstantR0<float>(&builder, 42.0), |
| 96 | ConstantR1<float>(&builder, {1.0, 2.0, 3.0})}); |
| 97 | auto global_data = ExecuteAndCheckTransfer(&builder, {}); |
| 98 | |
| 99 | ASSERT_IS_OK(client_->Unregister(*global_data)); |
| 100 | |
| 101 | auto transfer_status = client_->Transfer(*global_data); |
| 102 | ASSERT_FALSE(transfer_status.ok()); |
| 103 | ASSERT_THAT(transfer_status.status().error_message(), |
| 104 | HasSubstr("was previously deallocated")); |
| 105 | } |
| 106 | |
| 107 | XLA_TEST_F(DeallocationTest, DeallocateTupleWithRepeatedElements) { |
| 108 | XlaBuilder builder(TestName()); |