diff --git a/shared/source/execution_environment/execution_environment.cpp b/shared/source/execution_environment/execution_environment.cpp index 9cd3e35acf..7096732e7e 100644 --- a/shared/source/execution_environment/execution_environment.cpp +++ b/shared/source/execution_environment/execution_environment.cpp @@ -30,7 +30,7 @@ namespace NEO { ExecutionEnvironment::ExecutionEnvironment() { - WaitUtils::init(WaitUtils::WaitpkgUse::noUse); + WaitUtils::init(WaitUtils::WaitpkgUse::tpause); this->configureNeoEnvironment(); } diff --git a/shared/test/unit_test/utilities/x86_64/wait_util_tests_x86_64.cpp b/shared/test/unit_test/utilities/x86_64/wait_util_tests_x86_64.cpp index dc1948a4c3..4fb26dbbc3 100644 --- a/shared/test/unit_test/utilities/x86_64/wait_util_tests_x86_64.cpp +++ b/shared/test/unit_test/utilities/x86_64/wait_util_tests_x86_64.cpp @@ -9,6 +9,7 @@ #include "shared/source/utilities/wait_util.h" #include "shared/test/common/helpers/debug_manager_state_restore.h" #include "shared/test/common/helpers/variable_backup.h" +#include "shared/test/common/mocks/mock_execution_environment.h" #include "shared/test/common/test_macros/hw_test.h" #include "shared/test/unit_test/mocks/mock_cpuid_functions.h" @@ -209,6 +210,20 @@ TEST_F(WaitPkgTest, givenEnabledWaitPkgSetToTpauseAndWaitpkgSupportTrueWhenWaitI EXPECT_EQ(1, WaitUtils::waitPkgThresholdInMicroSeconds); } +TEST_F(WaitPkgTest, givenWaitpkgSupportTrueWhenCreateExecutionEnvironmentThenWaitPkgEnabled) { + CpuInfo::cpuidFunc = mockCpuidEnableAll; + + WaitUtils::waitpkgSupport = true; + + MockExecutionEnvironment executionEnvironment; + + EXPECT_EQ(1u, WaitUtils::waitCount); + EXPECT_EQ(16000u, WaitUtils::waitpkgCounterValue); + EXPECT_EQ(0u, WaitUtils::waitpkgControlValue); + EXPECT_EQ(WaitUtils::waitpkgUse, WaitUtils::WaitpkgUse::tpause); + EXPECT_EQ(1, WaitUtils::waitPkgThresholdInMicroSeconds); +} + TEST_F(WaitPkgTest, givenEnabledWaitPkgSetToTpauseAndWaitpkgThresholdAndWaitpkgSupportTrueWhenWaitInitializedAndCpuSupportsOperandThenWaitPkgEnabled) { CpuInfo::cpuidFunc = mockCpuidEnableAll;