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

Method InsertMemoryRegion

tensorflow/contrib/gdr/gdr_memory_manager.cc:588–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

586}
587
588void GdrMemoryManager::InsertMemoryRegion(void* addr, size_t length,
589 const std::string& allocator_name) {
590 if (length == 0) return;
591 ibv_mr* mr = rdma_reg_read(listening_.get(), addr, length);
592 if (mr != nullptr) {
593 mutex_lock l(alloc_mu_);
594 auto iter = std::upper_bound(mrs_.begin(), mrs_.end(), addr, &Comparator);
595 mrs_.insert(iter, {mr, &MRDeleter});
596 } else {
597 LOG(WARNING) << "Cannot register memory region allocated by "
598 << allocator_name;
599 }
600}
601
602void GdrMemoryManager::EvictMemoryRegion(void* addr, size_t length) {
603 if (length == 0) return;

Callers

nothing calls this directly

Calls 5

upper_boundFunction · 0.85
getMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected