static */
| 107 | } |
| 108 | |
| 109 | /* static */ StatusOr<std::shared_ptr<SharedDeviceBuffer>> |
| 110 | SharedDeviceBuffer::MakeTuple( |
| 111 | std::vector<std::shared_ptr<SharedDeviceBuffer>> children, |
| 112 | const Shape& on_host_shape, TransferManager* transfer_manager, |
| 113 | se::DeviceMemoryAllocator* allocator, int device_ordinal, |
| 114 | std::shared_ptr<BufferDefinitionEvent> definition_event) { |
| 115 | CHECK(on_host_shape.IsTuple() && |
| 116 | on_host_shape.tuple_shapes_size() == children.size()); |
| 117 | TF_ASSIGN_OR_RETURN( |
| 118 | se::OwningDeviceMemory device_memory, |
| 119 | allocator->Allocate( |
| 120 | device_ordinal, |
| 121 | transfer_manager->GetByteSizeRequirement(on_host_shape))); |
| 122 | return std::make_shared<SharedDeviceBuffer>( |
| 123 | allocator, device_ordinal, |
| 124 | std::initializer_list<se::DeviceMemoryBase>{device_memory.Release()}, |
| 125 | std::move(children), std::move(definition_event), |
| 126 | /*on_delete_callback=*/nullptr); |
| 127 | } |
| 128 | |
| 129 | /* static */ StatusOr<std::shared_ptr<SharedDeviceBuffer>> |
| 130 | SharedDeviceBuffer::MakeArray( |
nothing calls this directly
no test coverage detected