|
|
@@ -49,15 +49,16 @@ RdmaPoolAllocator::RdmaPoolAllocator(rtMemType_t memory_type) |
|
|
|
return reinterpret_cast<uintptr_t>(left->ptr) < reinterpret_cast<uintptr_t>(right->ptr); |
|
|
|
})) {} |
|
|
|
|
|
|
|
Status RdmaPoolAllocator::Initialize() { |
|
|
|
Status RdmaPoolAllocator::Initialize(uint32_t device_id) { |
|
|
|
GELOGI("Device id %u", device_id); |
|
|
|
memory_allocator_ = &MemManager::Instance().MemInstance(memory_type_); |
|
|
|
if (memory_allocator_ == nullptr) { |
|
|
|
return ACL_ERROR_GE_INTERNAL_ERROR; |
|
|
|
} |
|
|
|
return ge::SUCCESS; |
|
|
|
} |
|
|
|
void RdmaPoolAllocator::Finalize() { |
|
|
|
GELOGD("Rdma pool finalize start."); |
|
|
|
void RdmaPoolAllocator::Finalize(uint32_t device_id) { |
|
|
|
GELOGD("Rdma pool finalize start, device id:%u", device_id); |
|
|
|
for (auto it = allocated_blocks_.begin(); it != allocated_blocks_.end();) { |
|
|
|
auto block = it->second; |
|
|
|
it = allocated_blocks_.erase(it); |
|
|
|