Reset GT_SYSTEM_INFO values in ocloc

For AOT compilation, we don't want to set random/default values.
The uploaded structure to IGC will be reset.

Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This commit is contained in:
Daria Hinz
2022-03-23 15:37:39 +00:00
committed by Compute-Runtime-Automation
parent a230f267e1
commit efa57f734b
5 changed files with 51 additions and 25 deletions

View File

@@ -314,6 +314,31 @@ TEST_F(MultiCommandTests, GivenOutputFileListFlagWhenBuildingMultiCommandThenSuc
delete pMultiCommand;
}
TEST(MockOfflineCompilerTests, givenProductConfigValueWhenInitHwInfoThenResetGtSystemInfo) {
MockOfflineCompiler mockOfflineCompiler;
auto allEnabledDeviceConfigs = mockOfflineCompiler.argHelper->getAllSupportedDeviceConfigs();
if (allEnabledDeviceConfigs.empty()) {
GTEST_SKIP();
}
auto expectedRevId = 0u;
for (auto &deviceMapConfig : allEnabledDeviceConfigs) {
if (productFamily == deviceMapConfig.hwInfo->platform.eProductFamily) {
mockOfflineCompiler.deviceName = mockOfflineCompiler.argHelper->parseProductConfigFromValue(deviceMapConfig.config);
expectedRevId = deviceMapConfig.revId;
}
}
EXPECT_FALSE(mockOfflineCompiler.deviceName.empty());
mockOfflineCompiler.initHardwareInfo(mockOfflineCompiler.deviceName);
GT_SYSTEM_INFO expectedGtSystemInfo = {0};
EXPECT_EQ(mockOfflineCompiler.hwInfo.platform.usRevId, expectedRevId);
EXPECT_EQ(mockOfflineCompiler.hwInfo.platform.eProductFamily, productFamily);
EXPECT_EQ(memcmp(&mockOfflineCompiler.hwInfo.gtSystemInfo, &expectedGtSystemInfo, sizeof(GT_SYSTEM_INFO)), 0);
}
TEST_F(OfflineCompilerTests, GivenHelpOptionOnQueryThenSuccessIsReturned) {
std::vector<std::string> argv = {
"ocloc",