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

Method GetAllocatorLocked

tensorflow/compiler/jit/xla_device.cc:292–303  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292Allocator* XlaDevice::GetAllocatorLocked(AllocatorAttributes attr) {
293 if (attr.on_host()) {
294 return cpu_allocator();
295 }
296
297 if (xla_allocator_ == nullptr) {
298 xla::Backend* backend = client()->mutable_backend();
299 xla_allocator_ = XlaDeviceAllocatorState::GetOrCreateXlaDeviceAllocator(
300 backend, device_ordinal_);
301 }
302 return xla_allocator_;
303}
304
305Status XlaDevice::EnsureDeviceContextOk() {
306 mutex_lock lock(mu_);

Callers

nothing calls this directly

Calls 3

cpu_allocatorFunction · 0.85
on_hostMethod · 0.45
mutable_backendMethod · 0.45

Tested by

no test coverage detected