Use isMidThreadPreemptionSupported helper in compiler interface

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2021-09-08 13:38:48 +00:00
committed by Compute-Runtime-Automation
parent 5330c9cfd9
commit 9293c9b676
14 changed files with 60 additions and 6 deletions

View File

@@ -11,12 +11,14 @@
#include "shared/source/helpers/hw_info.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/test_files.h"
#include "shared/test/common/helpers/unit_test_helper.h"
#include "shared/test/common/mocks/mock_cif.h"
#include "shared/test/common/mocks/mock_compiler_interface.h"
#include "shared/test/common/mocks/mock_compilers.h"
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
#include "opencl/test/unit_test/global_environment.h"
#include "test.h"
#include "gmock/gmock.h"
#include "hw_cmds.h"
@@ -1161,6 +1163,16 @@ TEST_F(CompilerInterfaceTest, GivenRequestForNewFclTranslationCtxWhenInterfaceVe
setFclDebugVars(prevDebugVars);
}
HWTEST_F(CompilerInterfaceTest, whenIsMidThreadPreemptionSupportedIsCalledThenCorrectResultIsReturned) {
auto device = this->pDevice;
auto &hwInfo = *device->getRootDeviceEnvironment().getMutableHardwareInfo();
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(hwInfo, false);
EXPECT_FALSE(pCompilerInterface->isMidThreadPreemptionSupported(hwInfo));
UnitTestHelper<FamilyType>::setExtraMidThreadPreemptionFlag(hwInfo, true);
EXPECT_TRUE(pCompilerInterface->isMidThreadPreemptionSupported(hwInfo));
}
struct SpecConstantsTranslationCtxMock {
bool returnFalse = false;