MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / CreateFromBuffer

Method CreateFromBuffer

tensorflow/compiler/xrt/xrt_state.cc:220–232  ·  view source on GitHub ↗

static*/

Source from the content-addressed store, hash-verified

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
234Status XRTTupleAllocation::ToLiteral(xla::Backend* backend,
235 xla::MutableLiteralBase* literal) {

Callers

nothing calls this directly

Calls 3

SetDeviceMemorySizeMethod · 0.80
memory_allocatorMethod · 0.45

Tested by

no test coverage detected