Skip to content

Commit

Permalink
[CustomDevice] fix bug in custom allocator (PaddlePaddle#56977)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronny1996 authored and BeingGod committed Sep 9, 2023
1 parent 0ca6f53 commit e36ef30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion paddle/fluid/memory/allocation/custom_allocator.cc
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ void CustomAllocator::FreeImpl(phi::Allocation* allocation) {
platform::errors::PermissionDenied("CustomDevice memory is "
"freed in incorrect device. "
"This may be a bug"));

phi::DeviceManager::GetDeviceWithPlace(place_)->MemoryDeallocate(
allocation->ptr(), allocation->size());
delete allocation;
}

Expand Down

0 comments on commit e36ef30

Please sign in to comment.