Skip to content

Commit

Permalink
Avoid a segmentation fault when clearing cached blocks (ROCm#297)
Browse files Browse the repository at this point in the history
  • Loading branch information
benson31 authored and stanleytsang-amd committed Oct 20, 2023
1 parent bc59a0d commit 81c6746
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions hipcub/include/hipcub/backend/rocprim/util_allocator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -417,9 +417,7 @@ struct CachingDeviceAllocator
if (debug) _HipcubLog("\tDevice %d freed %lld bytes.\n\t\t %lld available blocks cached (%lld bytes), %lld live blocks (%lld bytes) outstanding.\n",
device, (long long) block_itr->bytes, (long long) cached_blocks.size(), (long long) cached_bytes[device].free, (long long) live_blocks.size(), (long long) cached_bytes[device].live);

cached_blocks.erase(block_itr);

block_itr++;
block_itr = cached_blocks.erase(block_itr);
}

// Unlock
Expand Down

0 comments on commit 81c6746

Please sign in to comment.