Skip to content

Commit 038d1d5

Browse files
Correct xe_hpc tests
Related-To: NEO-6631 Signed-off-by: Kamil Kopryk <[email protected]>
1 parent 43ed1ac commit 038d1d5

32 files changed

+187
-63
lines changed

level_zero/core/source/module/module_imp.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "shared/source/device_binary_format/elf/elf_encoder.h"
1818
#include "shared/source/device_binary_format/elf/ocl_elf.h"
1919
#include "shared/source/helpers/api_specific_config.h"
20+
#include "shared/source/helpers/compiler_hw_info_config.h"
2021
#include "shared/source/helpers/constants.h"
2122
#include "shared/source/helpers/kernel_helpers.h"
2223
#include "shared/source/helpers/string.h"
@@ -240,7 +241,10 @@ bool ModuleTranslationUnit::createFromNativeBinary(const char *input, size_t inp
240241
UNRECOVERABLE_IF((nullptr == device) || (nullptr == device->getNEODevice()));
241242
auto productAbbreviation = NEO::hardwarePrefix[device->getNEODevice()->getHardwareInfo().platform.eProductFamily];
242243

243-
NEO::TargetDevice targetDevice = NEO::targetDeviceFromHwInfo(device->getNEODevice()->getHardwareInfo());
244+
auto copyHwInfo = device->getNEODevice()->getHardwareInfo();
245+
const auto &compilerHwInfoConfig = *NEO::CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily);
246+
compilerHwInfoConfig.adjustHwInfoForIgc(copyHwInfo);
247+
NEO::TargetDevice targetDevice = NEO::targetDeviceFromHwInfo(copyHwInfo);
244248
std::string decodeErrors;
245249
std::string decodeWarnings;
246250
ArrayRef<const uint8_t> archive(reinterpret_cast<const uint8_t *>(input), inputSize);

level_zero/core/source/xe_hpc_core/l0_hw_helper_xe_hpc_core.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ void populateFactoryTable<L0HwHelperHw<Family>>() {
2424

2525
template <>
2626
bool L0HwHelperHw<Family>::isIpSamplingSupported(const NEO::HardwareInfo &hwInfo) const {
27-
2827
if (hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[0] ||
2928
hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[1] ||
3029
hwInfo.platform.usDeviceID == NEO::XE_HPC_CORE::pvcXtDeviceIds[2] ||

level_zero/core/test/unit_tests/sources/module/test_module.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2445,7 +2445,7 @@ TEST_F(ModuleWithZebinTest, givenNonZebinaryFormatWhenGettingDebugInfoThenDebugZ
24452445
EXPECT_EQ(retCode, ZE_RESULT_SUCCESS);
24462446
}
24472447

2448-
TEST_F(ModuleWithZebinTest, givenZebinWithKernelCallingExternalFunctionThenUpdateKernelsBarrierCount) {
2448+
HWTEST_F(ModuleWithZebinTest, givenZebinWithKernelCallingExternalFunctionThenUpdateKernelsBarrierCount) {
24492449
ZebinTestData::ZebinWithExternalFunctionsInfo zebin;
24502450
zebin.setProductFamily(static_cast<uint16_t>(device->getHwInfo().platform.eProductFamily));
24512451

level_zero/core/test/unit_tests/xe_hpc_core/test_cmdlist_xe_hpc_core.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -164,6 +164,10 @@ HWTEST2_F(CommandListEventFenceTestsXeHpcCore, givenCommandListWithProfilingEven
164164
using GfxFamily = typename NEO::GfxFamilyMapper<gfxCoreFamily>::GfxFamily;
165165
using MI_MEM_FENCE = typename FamilyType::MI_MEM_FENCE;
166166

167+
if (defaultHwInfo->platform.eProductFamily != IGFX_PVC) {
168+
GTEST_SKIP();
169+
}
170+
167171
auto commandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
168172
commandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
169173
ze_event_pool_desc_t eventPoolDesc = {};

level_zero/core/test/unit_tests/xe_hpc_core/test_cmdqueue_xe_hpc_core.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,10 @@ HWTEST2_F(CommandQueueCommandsPvc, whenExecuteCommandListsIsCalledThenAdditional
168168
GTEST_SKIP();
169169
}
170170

171+
if (defaultHwInfo->platform.eProductFamily != IGFX_PVC) {
172+
GTEST_SKIP();
173+
}
174+
171175
DebugManagerStateRestore restorer;
172176
DebugManager.flags.AllowMixingRegularAndCooperativeKernels.set(1);
173177
DebugManager.flags.AllowPatchingVfeStateInCommandLists.set(1);

level_zero/core/test/unit_tests/xe_hpc_core/test_device_xe_hpc_core.cpp

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,18 @@ namespace ult {
1919

2020
HWTEST_EXCLUDE_PRODUCT(AppendMemoryCopy, givenCopyOnlyCommandListAndHostPointersWhenMemoryCopyCalledThenPipeControlWithDcFlushAddedIsNotAddedAfterBlitCopy, IGFX_XE_HPC_CORE);
2121

22-
using DeviceTestPVC = Test<DeviceFixture>;
22+
using DeviceTestXeHpc = Test<DeviceFixture>;
2323

24-
HWTEST2_F(DeviceTestPVC, whenCallingGetMemoryPropertiesWithNonNullPtrThenPropertiesAreReturned, IsXeHpcCore) {
24+
HWTEST2_F(DeviceTestXeHpc, whenCallingGetMemoryPropertiesWithNonNullPtrThenPropertiesAreReturned, IsXeHpcCore) {
2525
uint32_t count = 0;
2626
ze_result_t res = device->getMemoryProperties(&count, nullptr);
2727
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
2828
EXPECT_EQ(1u, count);
2929

30+
if (defaultHwInfo->platform.eProductFamily != IGFX_PVC) {
31+
GTEST_SKIP();
32+
}
33+
3034
ze_device_memory_properties_t memProperties = {};
3135
res = device->getMemoryProperties(&count, &memProperties);
3236
EXPECT_EQ(res, ZE_RESULT_SUCCESS);
@@ -37,7 +41,7 @@ HWTEST2_F(DeviceTestPVC, whenCallingGetMemoryPropertiesWithNonNullPtrThenPropert
3741
EXPECT_EQ(memProperties.totalSize, this->neoDevice->getDeviceInfo().globalMemSize);
3842
}
3943

40-
HWTEST2_F(DeviceTestPVC, whenCallingGetMemoryPropertiesWithNonNullPtrAndBdRevisionIsNotA0ThenmaxClockRateReturnedIsZero, IsXeHpcCore) {
44+
HWTEST2_F(DeviceTestXeHpc, whenCallingGetMemoryPropertiesWithNonNullPtrAndBdRevisionIsNotA0ThenmaxClockRateReturnedIsZero, IsXeHpcCore) {
4145
uint32_t count = 0;
4246
auto device = driverHandle->devices[0];
4347
auto hwInfo = device->getNEODevice()->getRootDeviceEnvironment().getMutableHardwareInfo();
@@ -55,7 +59,7 @@ HWTEST2_F(DeviceTestPVC, whenCallingGetMemoryPropertiesWithNonNullPtrAndBdRevisi
5559
EXPECT_EQ(memProperties.maxClockRate, 0u);
5660
}
5761

58-
HWTEST2_F(DeviceTestPVC, givenPvcAStepWhenCreatingMultiTileDeviceThenExpectImplicitScalingDisabled, IsXeHpcCore) {
62+
HWTEST2_F(DeviceTestXeHpc, givenXeHpcAStepWhenCreatingMultiTileDeviceThenExpectImplicitScalingDisabled, IsXeHpcCore) {
5963
DebugManagerStateRestore restorer;
6064
DebugManager.flags.CreateMultipleSubDevices.set(2);
6165
VariableBackup<bool> apiSupportBackup(&NEO::ImplicitScaling::apiSupport, true);
@@ -65,6 +69,10 @@ HWTEST2_F(DeviceTestPVC, givenPvcAStepWhenCreatingMultiTileDeviceThenExpectImpli
6569
auto hwInfo = *NEO::defaultHwInfo;
6670
hwInfo.platform.usRevId = 0x3;
6771

72+
if (hwInfo.platform.eProductFamily != IGFX_PVC) {
73+
GTEST_SKIP();
74+
}
75+
6876
auto neoDevice = std::unique_ptr<NEO::Device>(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
6977
auto device = Device::create(driverHandle.get(), neoDevice.release(), false, &returnValue);
7078
ASSERT_NE(nullptr, device);
@@ -75,7 +83,7 @@ HWTEST2_F(DeviceTestPVC, givenPvcAStepWhenCreatingMultiTileDeviceThenExpectImpli
7583
delete device;
7684
}
7785

78-
HWTEST2_F(DeviceTestPVC, givenPvcAStepAndDebugFlagOverridesWhenCreatingMultiTileDeviceThenExpectImplicitScalingEnabled, IsXeHpcCore) {
86+
HWTEST2_F(DeviceTestXeHpc, givenXeHpcAStepAndDebugFlagOverridesWhenCreatingMultiTileDeviceThenExpectImplicitScalingEnabled, IsXeHpcCore) {
7987
DebugManagerStateRestore restorer;
8088
DebugManager.flags.CreateMultipleSubDevices.set(2);
8189
DebugManager.flags.EnableImplicitScaling.set(1);
@@ -96,7 +104,7 @@ HWTEST2_F(DeviceTestPVC, givenPvcAStepAndDebugFlagOverridesWhenCreatingMultiTile
96104
delete device;
97105
}
98106

99-
HWTEST2_F(DeviceTestPVC, givenPvcBStepWhenCreatingMultiTileDeviceThenExpectImplicitScalingEnabled, IsXeHpcCore) {
107+
HWTEST2_F(DeviceTestXeHpc, givenXeHpcBStepWhenCreatingMultiTileDeviceThenExpectImplicitScalingEnabled, IsXeHpcCore) {
100108
DebugManagerStateRestore restorer;
101109
DebugManager.flags.CreateMultipleSubDevices.set(2);
102110
VariableBackup<bool> apiSupportBackup(&NEO::ImplicitScaling::apiSupport, true);
@@ -201,7 +209,7 @@ HWTEST2_F(DeviceCopyQueueGroupTest,
201209
}
202210
}
203211

204-
HWTEST2_F(DeviceTestPVC, givenReturnedDevicePropertiesThenExpectedPropertyFlagsSet, IsPVC) {
212+
HWTEST2_F(DeviceTestXeHpc, givenReturnedDevicePropertiesThenExpectedPropertyFlagsSet, IsXeHpcCore) {
205213
ze_device_properties_t deviceProps = {ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES};
206214

207215
device->getProperties(&deviceProps);

opencl/source/program/program.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
#include "shared/source/device_binary_format/elf/ocl_elf.h"
1717
#include "shared/source/device_binary_format/patchtokens_decoder.h"
1818
#include "shared/source/helpers/api_specific_config.h"
19+
#include "shared/source/helpers/compiler_hw_info_config.h"
1920
#include "shared/source/helpers/compiler_options_parser.h"
2021
#include "shared/source/helpers/debug_helpers.h"
2122
#include "shared/source/helpers/hw_helper.h"
@@ -162,6 +163,10 @@ cl_int Program::createProgramFromBinary(
162163
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
163164
auto productAbbreviation = hardwarePrefix[hwInfo->platform.eProductFamily];
164165

166+
auto copyHwInfo = *hwInfo;
167+
const auto &compilerHwInfoConfig = *CompilerHwInfoConfig::get(copyHwInfo.platform.eProductFamily);
168+
compilerHwInfoConfig.adjustHwInfoForIgc(copyHwInfo);
169+
165170
TargetDevice targetDevice = targetDeviceFromHwInfo(*hwInfo);
166171
std::string decodeErrors;
167172
std::string decodeWarnings;

opencl/test/unit_test/aub_tests/xe_hp_core/aub_mem_dump_tests_xe_hp_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ XE_HP_CORE_TEST_F(XeHpCoreAubMemDumpTests, GivenCcsThenExpectationsAreMet) {
2020
setupAUB<FamilyType>(pDevice, aub_stream::ENGINE_CCS);
2121
}
2222

23-
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwareContext) {
23+
XE_HP_CORE_TEST_F(XeHpCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwareContext) {
2424
DebugManagerStateRestore restore;
2525
VariableBackup<UltHwConfig> backup(&ultHwConfig);
2626
ultHwConfig.useHwCsr = true;

opencl/test/unit_test/aub_tests/xe_hpc_core/aub_mem_dump_tests_xe_hpc_core.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,10 @@
1111
using XeHpcCoreAubMemDumpTests = Test<NEO::ClDeviceFixture>;
1212

1313
XE_HPC_CORETEST_F(XeHpcCoreAubMemDumpTests, GivenCcsThenExpectationsAreMet) {
14+
15+
if (NEO::defaultHwInfo->platform.eProductFamily != IGFX_PVC) {
16+
GTEST_SKIP();
17+
}
18+
1419
setupAUB<FamilyType>(pDevice, aub_stream::ENGINE_CCS);
1520
}

opencl/test/unit_test/aub_tests/xe_hpg_core/aub_mem_dump_tests_xe_hpg_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ XE_HPG_CORETEST_F(XeHpgCoreAubMemDumpTests, GivenCcsThenExpectationsAreMet) {
2020
setupAUB<FamilyType>(pDevice, aub_stream::ENGINE_CCS);
2121
}
2222

23-
HWCMDTEST_F(IGFX_XE_HP_CORE, XeHpgCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwareContext) {
23+
XE_HPG_CORETEST_F(XeHpgCoreAubMemDumpTests, whenAubCsrIsCreatedThenCreateHardwareContext) {
2424
DebugManagerStateRestore restore;
2525
VariableBackup<UltHwConfig> backup(&ultHwConfig);
2626
ultHwConfig.useHwCsr = true;

0 commit comments

Comments
 (0)