mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Move KMD Notify logic from CSR to specialized helper
- Decission about timeout enabling and value moved out of CSR - Timeout multiplier is no longer Linux specific Change-Id: I6858fe2f811ef13802b95e0470e310210a9dea8b
This commit is contained in:
committed by
sys_ocldev
parent
10ada58bd6
commit
87f8f735f9
@@ -25,6 +25,23 @@
|
||||
|
||||
using namespace OCLRT;
|
||||
|
||||
bool KmdNotifyProperties::timeoutEnabled(FlushStamp flushStampToWait) const {
|
||||
return enableKmdNotify && flushStampToWait != 0;
|
||||
}
|
||||
|
||||
int64_t KmdNotifyProperties::pickTimeoutValue(std::chrono::high_resolution_clock::time_point &lastWaitTimestamp,
|
||||
bool quickKmdSleepRequest, uint32_t currentHwTag, uint32_t taskCountToWait) const {
|
||||
quickKmdSleepRequest |= applyQuickKmdSleepForSporadicWait(lastWaitTimestamp);
|
||||
|
||||
if (quickKmdSleepRequest && enableQuickKmdSleep) {
|
||||
return delayQuickKmdSleepMicroseconds;
|
||||
}
|
||||
|
||||
int64_t multiplier = (currentHwTag < taskCountToWait) ? static_cast<int64_t>(taskCountToWait - currentHwTag) : 1;
|
||||
|
||||
return delayKmdNotifyMicroseconds * multiplier;
|
||||
}
|
||||
|
||||
bool KmdNotifyProperties::applyQuickKmdSleepForSporadicWait(std::chrono::high_resolution_clock::time_point &lastWaitTimestamp) const {
|
||||
if (enableQuickKmdSleepForSporadicWaits) {
|
||||
auto now = std::chrono::high_resolution_clock::now();
|
||||
@@ -36,11 +53,6 @@ bool KmdNotifyProperties::applyQuickKmdSleepForSporadicWait(std::chrono::high_re
|
||||
return false;
|
||||
}
|
||||
|
||||
const int64_t &KmdNotifyProperties::selectDelay(bool useQuickKmdSleep) const {
|
||||
return (useQuickKmdSleep && enableQuickKmdSleep) ? delayQuickKmdSleepMicroseconds
|
||||
: delayKmdNotifyMicroseconds;
|
||||
}
|
||||
|
||||
void KmdNotifyProperties::overrideFromDebugVariable(int32_t debugVariableValue, int64_t &destination) {
|
||||
if (debugVariableValue >= 0) {
|
||||
destination = static_cast<int64_t>(debugVariableValue);
|
||||
|
||||
Reference in New Issue
Block a user