diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/util/simple_heap.h b/projects/rocr-runtime/runtime/hsa-runtime/core/util/simple_heap.h index 51eb38eb84..ef4c8cb477 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/util/simple_heap.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/util/simple_heap.h @@ -300,6 +300,9 @@ template class SimpleHeap { (frag_map.rbegin()->first + frag_map.rbegin()->second.size <= base)) return false; + // Is block already discarded? + if (frag_map.begin()->second.discard) return true; + // Mark all fragments for discard and compute block size. Removes freelist records for all // fragments in the block. size_t size = 0;