Skip to content

Commit a400e61

Browse files
Sourabh Betigerigargrahul
authored andcommitted
SWDEV-407954 - Fixes malloc tchunck and hipGraphAddMemFreeNode crashes
Change-Id: I3c77da3bc7edd6e92b3c8066dde4728703e545a9
1 parent 8514aac commit a400e61

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

hipamd/src/hip_internal.hpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,12 @@ namespace hip {
371371
captureEvents_.erase(it);
372372
}
373373
}
374-
void SetParallelCaptureStream(hipStream_t s) { parallelCaptureStreams_.push_back(s); }
374+
void SetParallelCaptureStream(hipStream_t s) {
375+
auto it = std::find(parallelCaptureStreams_.begin(), parallelCaptureStreams_.end(), s);
376+
if (it == parallelCaptureStreams_.end()) {
377+
parallelCaptureStreams_.push_back(s);
378+
}
379+
}
375380
void EraseParallelCaptureStream(hipStream_t s) {
376381
auto it = std::find(parallelCaptureStreams_.begin(), parallelCaptureStreams_.end(), s);
377382
if (it != parallelCaptureStreams_.end()) {

hipamd/src/hip_mempool_impl.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,9 @@ struct MemoryTimestamp {
6363
} else if (opportunistic && (event_ != nullptr)) {
6464
// Check HIP event for a retired status
6565
result = (event_->query() == hipSuccess) ? true : false;
66+
} else if (event_ == nullptr) {
67+
// Event doesn't exist. It was a safe release with explicit wait
68+
return true;
6669
}
6770
return result;
6871
}

0 commit comments

Comments
 (0)