SWDEV-334150 - Force callback to cycle commands

Enqueue a handler callback for hipEventRecords(aka marker_ts_) for every
64 submits, This recycles the memory if we dont end up calling
synchronize for the longest time.

Change-Id: I3d39fe76d52a5d81387927edd85b5663b563682c
Este commit está contenido en:
Saleel Kudchadker
2022-04-27 11:13:41 -07:00
padre 934149ff0a
commit fa76f03654
Se han modificado 3 ficheros con 23 adiciones y 2 borrados
+10 -1
Ver fichero
@@ -336,6 +336,7 @@ void Command::releaseResources() {
}
}
static constexpr uint32_t kMarkerTsCount = 64;
// ================================================================================================
void Command::enqueue() {
assert(queue_ != NULL && "Cannot be enqueued");
@@ -368,7 +369,15 @@ void Command::enqueue() {
EnableProfiling();
}
if (isMarker && (!profilingInfo().marker_ts_)) {
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) {
submitBatch = true;
queue_->ResetMarkerTsCount();
}
if (isMarker && submitBatch) {
// Update batch head for the current marker. Hence the status of all commands can be
// updated upon the marker completion
SetBatchHead(queue_->GetSubmittionBatch());