| 28 | namespace { |
| 29 | |
| 30 | TEST(ShapedBufferTest, ScopedShapeBufferAsShapedBufferB71629047) { |
| 31 | TF_ASSERT_OK_AND_ASSIGN(auto* platform, |
| 32 | xla::PlatformUtil::GetDefaultPlatform()); |
| 33 | TF_ASSERT_OK_AND_ASSIGN(auto executors, |
| 34 | xla::PlatformUtil::GetStreamExecutors(platform)); |
| 35 | xla::se::StreamExecutorMemoryAllocator allocator(platform, executors); |
| 36 | const xla::Shape shape = xla::ShapeUtil::MakeShape(xla::F32, {}); |
| 37 | const int kDeviceOrdinal = 0; |
| 38 | auto scoped_buffer = absl::make_unique<xla::ScopedShapedBuffer>( |
| 39 | shape, shape, &allocator, kDeviceOrdinal); |
| 40 | std::unique_ptr<xla::ShapedBuffer> buffer = std::move(scoped_buffer); |
| 41 | buffer = nullptr; |
| 42 | } |
| 43 | |
| 44 | class TestAllocator : public se::DeviceMemoryAllocator { |
| 45 | public: |
nothing calls this directly
no test coverage detected