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

Method Lookup

tensorflow/compiler/xrt/xrt_memory_manager.cc:216–229  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216xla::StatusOr<RefPtr<XRTTupleAllocation>> XRTMemoryManager::Lookup(
217 int64 handle) {
218 int device_ordinal = GetDeviceFromHandle(handle);
219 DeviceContext* device_context = GetDeviceContext(device_ordinal,
220 /*create_if_missing=*/false);
221 if (device_context == nullptr) {
222 return errors::NotFound("XRT memory handle not found: ", handle);
223 }
224 RefPtr<XRTTupleAllocation> tuple = device_context->Lookup(handle);
225 if (tuple == nullptr) {
226 return errors::NotFound("XRT memory handle not found: ", handle);
227 }
228 return std::move(tuple);
229}
230
231Status XRTMemoryManager::Release(int64 handle) {
232 int device_ordinal = GetDeviceFromHandle(handle);

Callers 7

ParseTupleNodeMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45
ComputeMethod · 0.45
DoWorkMethod · 0.45
ComputeMethod · 0.45

Calls 2

GetDeviceFromHandleFunction · 0.85
NotFoundFunction · 0.85

Tested by

no test coverage detected