performance: add windows thread priority debug key

Set windows thread priority to "above normal" on wddm init if flag is
set.

Related-To: NEO-8215

Signed-off-by: Dominik Dabek <dominik.dabek@intel.com>
This commit is contained in:
Dominik Dabek
2024-01-12 15:43:57 +00:00
committed by Compute-Runtime-Automation
parent 9b0c64abef
commit 997bdfa010
10 changed files with 75 additions and 10 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2023 Intel Corporation
* Copyright (C) 2018-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -96,6 +96,9 @@ DWORD setFilePointerResult = 0;
size_t setProcessPowerThrottlingStateCalled = 0u;
ProcessPowerThrottlingState setProcessPowerThrottlingStateLastValue{};
size_t setThreadPriorityCalled = 0u;
ThreadPriority setThreadPriorityLastValue{};
bool pathExists(const std::string &path) {
std::string tempP1 = path;
if (!path.empty() && path.back() == PATH_SEPARATOR) {
@@ -281,6 +284,11 @@ void setProcessPowerThrottlingState(ProcessPowerThrottlingState state) {
setProcessPowerThrottlingStateLastValue = state;
}
void setThreadPriority(ThreadPriority priority) {
setThreadPriorityCalled++;
setThreadPriorityLastValue = priority;
}
LSTATUS regOpenKeyExA(HKEY hKey, LPCSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult) {
if (regOpenKeySuccessCount > 0) {
regOpenKeySuccessCount--;