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

Method FindMemoryRegion

tensorflow/contrib/gdr/gdr_memory_manager.cc:577–586  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

575}
576
577ibv_mr* GdrMemoryManager::FindMemoryRegion(const Tensor* tensor) {
578 const void* addr = DMAHelper::buffer(tensor)->data();
579 mutex_lock l(alloc_mu_);
580 auto iter = std::upper_bound(mrs_.begin(), mrs_.end(), addr, &Comparator);
581 if (iter == std::end(mrs_) || iter->get()->addr > addr) {
582 return nullptr;
583 } else {
584 return iter->get();
585 }
586}
587
588void GdrMemoryManager::InsertMemoryRegion(void* addr, size_t length,
589 const std::string& allocator_name) {

Callers

nothing calls this directly

Calls 6

bufferFunction · 0.85
upper_boundFunction · 0.85
dataMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected