SWDEV-345683 - Fix HIP out of memory

If for every eventRecord handler is not submitted,
memory is not getting released during hipFree and leads to OOM.

Change-Id: I19b61a0c523502e9e1a3564ce8b791f3e2cea02c


[ROCm/clr commit: 7b1c6d06d5]
Tento commit je obsažen v:
Anusha Godavarthy Surya authored and Anusha Godavarthy Surya committed 2022-07-28 07:36:38 -04:00
1 rodič 11f9cdebba
revize b66ec1a031
1 file changed
+2 -2
+2 -2
Zobrazit soubor
@@ -336,7 +336,7 @@ void Command::releaseResources() {
}
}
static constexpr uint32_t kMarkerTsCount = 64;
static constexpr uint32_t kMarkerTsCount = 1;
// ================================================================================================
void Command::enqueue() {
assert(queue_ != NULL && "Cannot be enqueued");
@@ -372,7 +372,7 @@ void Command::enqueue() {
bool submitBatch = !profilingInfo().marker_ts_;
// Flush the batch if ther marker_ts have been continuously submitted until a threashold
// is reached. This helps recycling the commands and frees memory.
if (queue_->GetMarkerTsCount() > kMarkerTsCount) {
if (queue_->GetMarkerTsCount() >= kMarkerTsCount) {
submitBatch = true;
queue_->ResetMarkerTsCount();
}