static*/
| 218 | } |
| 219 | |
| 220 | /*static*/ Status XRTTupleAllocation::CreateFromBuffer( |
| 221 | const xla::ShapedBuffer& shaped_buffer, xla::Backend* backend, |
| 222 | int device_ordinal, XRTTupleAllocation** allocation) { |
| 223 | auto allocator = backend->memory_allocator(); |
| 224 | |
| 225 | *allocation = new XRTTupleAllocation(device_ordinal, allocator, |
| 226 | shaped_buffer.on_host_shape(), |
| 227 | shaped_buffer.on_device_shape()); |
| 228 | (*allocation) |
| 229 | ->InitializeFromShapedBuffer(shaped_buffer, allocator, device_ordinal); |
| 230 | (*allocation)->SetDeviceMemorySize(); |
| 231 | return Status::OK(); |
| 232 | } |
| 233 | |
| 234 | Status XRTTupleAllocation::ToLiteral(xla::Backend* backend, |
| 235 | xla::MutableLiteralBase* literal) { |
nothing calls this directly
no test coverage detected