performance: optimize counter based waiting schemes

- store latest waited counter value.
- do not wait on values that are already completed.
- disable mechanism when counter overflows.

Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
Michal Mrozek
2024-04-25 15:08:55 +00:00
committed by Compute-Runtime-Automation
parent 205f8d2ffd
commit 4aa7c6c99e
4 changed files with 88 additions and 11 deletions

View File

@@ -80,12 +80,20 @@ class InOrderExecInfo : public NEO::NonCopyableClass {
void reset();
bool isExternalMemoryExecInfo() const { return deviceCounterNode == nullptr; }
void setLastWaitedCounterValue(uint64_t value) {
lastWaitedCounterValue = std::max(value, lastWaitedCounterValue);
}
bool isCounterAlreadyDone(uint64_t waitValue) const {
return lastWaitedCounterValue >= waitValue && this->allocationOffset == 0u;
}
protected:
NEO::MemoryManager &memoryManager;
NEO::TagNodeBase *deviceCounterNode = nullptr;
NEO::TagNodeBase *hostCounterNode = nullptr;
uint64_t counterValue = 0;
uint64_t lastWaitedCounterValue = 0;
uint64_t regularCmdListSubmissionCounter = 0;
uint64_t deviceAddress = 0;