Skip to content

Commit fbf1f36

Browse files
Dont create blitter engine when blitter support is disabled
Related-To: NEO-6325 Signed-off-by: Mateusz Jablonski <[email protected]>
1 parent ee418ef commit fbf1f36

File tree

19 files changed

+133
-74
lines changed

19 files changed

+133
-74
lines changed

level_zero/core/test/unit_tests/sources/cmdlist/test_cmdlist_3.cpp

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -873,12 +873,17 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenMemoryCopyRegionWithSi
873873

874874
using ImageSupported = IsAtLeastProduct<IGFX_SKYLAKE>;
875875

876-
HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyRegionFromImageToImageUsingRenderThenSuccessIsReturned, IsAtLeastXeHpCore) {
876+
struct CommandListCreateWithBcs : public CommandListCreate {
877+
void SetUp() override {
878+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
879+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
880+
CommandListCreate::SetUp();
881+
}
882+
};
883+
HWTEST2_F(CommandListCreateWithBcs, givenImmediateCommandListWhenCopyRegionFromImageToImageUsingRenderThenSuccessIsReturned, IsAtLeastXeHpCore) {
877884
const ze_command_queue_desc_t queueDesc = {};
878885
bool internalEngine = true;
879886

880-
neoDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
881-
882887
ze_result_t returnValue;
883888
std::unique_ptr<L0::CommandList> commandList0(CommandList::createImmediate(productFamily,
884889
device,
@@ -919,7 +924,7 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyRegionFromImageToI
919924
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
920925
}
921926

922-
HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyRegionFromImageToImageUsingCopyWintInvalidRegionArguementsThenErrorIsReturned, IsAtLeastXeHpCore) {
927+
HWTEST2_F(CommandListCreateWithBcs, givenImmediateCommandListWhenCopyRegionFromImageToImageUsingCopyWintInvalidRegionArguementsThenErrorIsReturned, IsAtLeastXeHpCore) {
923928
const ze_command_queue_desc_t queueDesc = {};
924929
bool internalEngine = true;
925930

@@ -965,7 +970,7 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyRegionFromImageToI
965970
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, returnValue);
966971
}
967972

968-
HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyFromImageToImageUsingRenderThenSuccessIsReturned, IsAtLeastXeHpCore) {
973+
HWTEST2_F(CommandListCreateWithBcs, givenImmediateCommandListWhenCopyFromImageToImageUsingRenderThenSuccessIsReturned, IsAtLeastXeHpCore) {
969974
const ze_command_queue_desc_t queueDesc = {};
970975
bool internalEngine = true;
971976

@@ -1009,7 +1014,7 @@ HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenCopyFromImageToImageUs
10091014
EXPECT_EQ(ZE_RESULT_SUCCESS, returnValue);
10101015
}
10111016

1012-
HWTEST2_F(CommandListCreate, givenImmediateCommandListWhenMemoryCopyRegionWithSignalAndInvalidWaitHandleUsingCopyEngineThenErrorIsReturned, Platforms) {
1017+
HWTEST2_F(CommandListCreateWithBcs, givenImmediateCommandListWhenMemoryCopyRegionWithSignalAndInvalidWaitHandleUsingCopyEngineThenErrorIsReturned, Platforms) {
10131018
const ze_command_queue_desc_t desc = {};
10141019
bool internalEngine = true;
10151020

@@ -1176,7 +1181,7 @@ TEST_F(CommandListCreate, whenCreatingImmCmdListWithASyncModeAndAppendEventReset
11761181
EXPECT_EQ(event_object->queryStatus(), ZE_RESULT_SUCCESS);
11771182
}
11781183

1179-
TEST_F(CommandListCreate, givenQueueDescriptionwhenCreatingImmediateCommandListForCopyEnigneThenItHasImmediateCommandQueueCreated) {
1184+
TEST_F(CommandListCreateWithBcs, givenQueueDescriptionwhenCreatingImmediateCommandListForCopyEnigneThenItHasImmediateCommandQueueCreated) {
11801185
auto &engines = neoDevice->getEngineGroups();
11811186
uint32_t numaAvailableEngineGroups = 0;
11821187
for (uint32_t ordinal = 0; ordinal < CommonConstants::engineGroupCount; ordinal++) {

level_zero/core/test/unit_tests/sources/debugger/test_l0_debugger.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -517,7 +517,13 @@ HWTEST2_F(L0DebuggerTest, givenDebuggingEnabledWhenCommandListIsExecutedThenSbaB
517517
commandList->destroy();
518518
}
519519

520-
using L0DebuggerInternalUsageTest = L0DebuggerTest;
520+
struct L0DebuggerInternalUsageTest : public L0DebuggerTest {
521+
void SetUp() override {
522+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
523+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
524+
L0DebuggerTest::SetUp();
525+
}
526+
};
521527
HWTEST_F(L0DebuggerInternalUsageTest, givenFlushTaskSubmissionEnabledWhenCommandListIsInititalizedOrResetThenCaptureSbaIsNotCalled) {
522528
using STATE_BASE_ADDRESS = typename FamilyType::STATE_BASE_ADDRESS;
523529

opencl/test/unit_test/command_queue/command_queue_tests.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1691,7 +1691,11 @@ struct CommandQueueOnSpecificEngineTests : ::testing::Test {
16911691

16921692
HWTEST_F(CommandQueueOnSpecificEngineTests, givenMultipleFamiliesWhenCreatingQueueOnSpecificEngineThenUseCorrectEngine) {
16931693
auto raiiHwHelper = overrideHwHelper<FamilyType, MockHwHelper<FamilyType, 0, 1, 1>>();
1694-
MockContext context{};
1694+
HardwareInfo hwInfo = *defaultHwInfo;
1695+
hwInfo.capabilityTable.blitterOperationsSupported = true;
1696+
MockDevice *device = MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0);
1697+
MockClDevice clDevice{device};
1698+
MockContext context{&clDevice};
16951699
cl_command_queue_properties properties[5] = {};
16961700

16971701
fillProperties(properties, 0, 0);
@@ -1732,6 +1736,9 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenRootDeviceAndMultipleFamiliesWh
17321736

17331737
HWTEST_F(CommandQueueOnSpecificEngineTests, givenSubDeviceAndMultipleFamiliesWhenCreatingQueueOnSpecificEngineThenUseDefaultEngine) {
17341738
auto raiiHwHelper = overrideHwHelper<FamilyType, MockHwHelper<FamilyType, 0, 1, 1>>();
1739+
1740+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
1741+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
17351742
UltClDeviceFactory deviceFactory{1, 2};
17361743
MockContext context{deviceFactory.subDevices[0]};
17371744
cl_command_queue_properties properties[5] = {};
@@ -1758,6 +1765,9 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenSubDeviceAndMultipleFamiliesWhe
17581765

17591766
HWTEST_F(CommandQueueOnSpecificEngineTests, givenBcsFamilySelectedWhenCreatingQueueOnSpecificEngineThenInitializeBcsProperly) {
17601767
auto raiiHwHelper = overrideHwHelper<FamilyType, MockHwHelper<FamilyType, 0, 0, 1>>();
1768+
1769+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
1770+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
17611771
MockContext context{};
17621772
cl_command_queue_properties properties[5] = {};
17631773

opencl/test/unit_test/command_queue/enqueue_kernel_2_tests.cpp

Lines changed: 42 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include "shared/test/common/cmd_parse/gen_cmd_parse.h"
1212
#include "shared/test/common/helpers/debug_manager_state_restore.h"
1313
#include "shared/test/common/mocks/mock_csr.h"
14+
#include "shared/test/common/mocks/ult_device_factory.h"
1415
#include "shared/test/unit_test/utilities/base_object_utils.h"
1516

1617
#include "opencl/test/unit_test/command_queue/enqueue_fixture.h"
@@ -781,37 +782,37 @@ HWTEST_F(EnqueueKernelTests, whenEnqueueingKernelThenCsrCorrectlySetsRequiredThr
781782
typedef HelloWorldFixture<HelloWorldFixtureFactory> EnqueueKernelFixture;
782783
typedef Test<EnqueueKernelFixture> EnqueueKernelTest;
783784

784-
struct EnqueueAuxKernelTests : public EnqueueKernelTest {
785-
template <typename FamilyType>
786-
class MyCmdQ : public MockCommandQueueHw<FamilyType> {
787-
public:
788-
using CommandQueueHw<FamilyType>::commandStream;
789-
using CommandQueueHw<FamilyType>::gpgpuEngine;
790-
using CommandQueueHw<FamilyType>::bcsEngines;
791-
MyCmdQ(Context *context, ClDevice *device) : MockCommandQueueHw<FamilyType>(context, device, nullptr) {}
792-
void dispatchAuxTranslationBuiltin(MultiDispatchInfo &multiDispatchInfo, AuxTranslationDirection auxTranslationDirection) override {
793-
CommandQueueHw<FamilyType>::dispatchAuxTranslationBuiltin(multiDispatchInfo, auxTranslationDirection);
794-
auxTranslationDirections.push_back(auxTranslationDirection);
795-
Kernel *lastKernel = nullptr;
796-
for (const auto &dispatchInfo : multiDispatchInfo) {
797-
lastKernel = dispatchInfo.getKernel();
798-
dispatchInfos.emplace_back(dispatchInfo);
799-
}
800-
dispatchAuxTranslationInputs.emplace_back(lastKernel, multiDispatchInfo.size(), *multiDispatchInfo.getKernelObjsForAuxTranslation(),
801-
auxTranslationDirection);
785+
template <typename FamilyType>
786+
class MyCmdQ : public MockCommandQueueHw<FamilyType> {
787+
public:
788+
using CommandQueueHw<FamilyType>::commandStream;
789+
using CommandQueueHw<FamilyType>::gpgpuEngine;
790+
using CommandQueueHw<FamilyType>::bcsEngines;
791+
MyCmdQ(Context *context, ClDevice *device) : MockCommandQueueHw<FamilyType>(context, device, nullptr) {}
792+
void dispatchAuxTranslationBuiltin(MultiDispatchInfo &multiDispatchInfo, AuxTranslationDirection auxTranslationDirection) override {
793+
CommandQueueHw<FamilyType>::dispatchAuxTranslationBuiltin(multiDispatchInfo, auxTranslationDirection);
794+
auxTranslationDirections.push_back(auxTranslationDirection);
795+
Kernel *lastKernel = nullptr;
796+
for (const auto &dispatchInfo : multiDispatchInfo) {
797+
lastKernel = dispatchInfo.getKernel();
798+
dispatchInfos.emplace_back(dispatchInfo);
802799
}
800+
dispatchAuxTranslationInputs.emplace_back(lastKernel, multiDispatchInfo.size(), *multiDispatchInfo.getKernelObjsForAuxTranslation(),
801+
auxTranslationDirection);
802+
}
803803

804-
void waitUntilComplete(uint32_t gpgpuTaskCountToWait, Range<CopyEngineState> copyEnginesToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, bool cleanTemporaryAllocationList) override {
805-
waitCalled++;
806-
MockCommandQueueHw<FamilyType>::waitUntilComplete(gpgpuTaskCountToWait, copyEnginesToWait, flushStampToWait, useQuickKmdSleep, cleanTemporaryAllocationList);
807-
}
804+
void waitUntilComplete(uint32_t gpgpuTaskCountToWait, Range<CopyEngineState> copyEnginesToWait, FlushStamp flushStampToWait, bool useQuickKmdSleep, bool cleanTemporaryAllocationList) override {
805+
waitCalled++;
806+
MockCommandQueueHw<FamilyType>::waitUntilComplete(gpgpuTaskCountToWait, copyEnginesToWait, flushStampToWait, useQuickKmdSleep, cleanTemporaryAllocationList);
807+
}
808808

809-
std::vector<AuxTranslationDirection> auxTranslationDirections;
810-
std::vector<DispatchInfo> dispatchInfos;
811-
std::vector<std::tuple<Kernel *, size_t, KernelObjsForAuxTranslation, AuxTranslationDirection>> dispatchAuxTranslationInputs;
812-
uint32_t waitCalled = 0;
813-
};
809+
std::vector<AuxTranslationDirection> auxTranslationDirections;
810+
std::vector<DispatchInfo> dispatchInfos;
811+
std::vector<std::tuple<Kernel *, size_t, KernelObjsForAuxTranslation, AuxTranslationDirection>> dispatchAuxTranslationInputs;
812+
uint32_t waitCalled = 0;
813+
};
814814

815+
struct EnqueueAuxKernelTests : public EnqueueKernelTest {
815816
void SetUp() override {
816817
DebugManager.flags.ForceAuxTranslationMode.set(static_cast<int32_t>(AuxTranslationMode::Builtin));
817818
EnqueueKernelTest::SetUp();
@@ -927,16 +928,27 @@ HWTEST_F(EnqueueAuxKernelTests, givenKernelWithRequiredAuxTranslationWhenEnqueue
927928
EXPECT_TRUE(kernelAfter->isBuiltIn);
928929
}
929930

930-
HWTEST_F(EnqueueAuxKernelTests, givenDebugVariableDisablingBuiltinTranslationWhenDispatchingKernelWithRequiredAuxTranslationThenDontDispatch) {
931+
using BlitAuxKernelTests = ::testing::Test;
932+
HWTEST_F(BlitAuxKernelTests, givenDebugVariableDisablingBuiltinTranslationWhenDispatchingKernelWithRequiredAuxTranslationThenDontDispatch) {
933+
DebugManagerStateRestore dbgRestore;
931934
DebugManager.flags.ForceAuxTranslationMode.set(static_cast<int32_t>(AuxTranslationMode::Blit));
935+
936+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
937+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
938+
939+
UltClDeviceFactory factory{1, 0};
940+
auto rootDeviceIndex = 0u;
941+
auto pClDevice = factory.rootDevices[rootDeviceIndex];
942+
auto pDevice = factory.pUltDeviceFactory->rootDevices[rootDeviceIndex];
932943
pDevice->getUltCommandStreamReceiver<FamilyType>().timestampPacketWriteEnabled = true;
933944

934945
auto hwInfo = pDevice->getExecutionEnvironment()->rootDeviceEnvironments[rootDeviceIndex]->getMutableHardwareInfo();
935946
hwInfo->capabilityTable.blitterOperationsSupported = true;
936947
REQUIRE_FULL_BLITTER_OR_SKIP(hwInfo);
937948

938-
MockKernelWithInternals mockKernel(*pClDevice, context);
939-
MyCmdQ<FamilyType> cmdQ(context, pClDevice);
949+
MockContext context(pClDevice);
950+
MockKernelWithInternals mockKernel(context.getDevices(), &context);
951+
MyCmdQ<FamilyType> cmdQ(&context, pClDevice);
940952

941953
size_t gws[3] = {1, 0, 0};
942954
MockBuffer buffer;

opencl/test/unit_test/command_queue/enqueue_read_image_tests.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -857,7 +857,15 @@ HWTEST_F(EnqueueReadImageTest, GivenImage1DThatIsZeroCopyWhenReadImageWithTheSam
857857
pEvent->release();
858858
}
859859

860-
HWTEST_F(EnqueueReadImageTest, givenDeviceWithBlitterSupportWhenEnqueueReadImageThenBlitEnqueueImageAllowedReturnsCorrectResult) {
860+
struct EnqueueReadImageTestWithBcs : EnqueueReadImageTest {
861+
void SetUp() override {
862+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
863+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
864+
EnqueueReadImageTest::SetUp();
865+
}
866+
};
867+
868+
HWTEST_F(EnqueueReadImageTestWithBcs, givenDeviceWithBlitterSupportWhenEnqueueReadImageThenBlitEnqueueImageAllowedReturnsCorrectResult) {
861869
DebugManagerStateRestore restorer;
862870
DebugManager.flags.EnableBlitterForEnqueueOperations.set(1);
863871
DebugManager.flags.EnableBlitterForEnqueueImageOperations.set(1);

opencl/test/unit_test/command_stream/command_stream_receiver_flush_task_4_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,8 @@ HWTEST_F(MultiRootDeviceCommandStreamReceiverTests, givenMultipleEventInMultiRoo
253253
struct CrossDeviceDependenciesTests : public ::testing::Test {
254254

255255
void SetUp() override {
256-
256+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
257+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
257258
deviceFactory = std::make_unique<UltClDeviceFactory>(3, 0);
258259
auto device1 = deviceFactory->rootDevices[1];
259260
auto device2 = deviceFactory->rootDevices[2];
@@ -502,7 +503,6 @@ HWTEST_F(CrossDeviceDependenciesTests, givenWaitListWithEventBlockedByUserEventW
502503
DebugManager.flags.EnableBlitterForEnqueueOperations.set(true);
503504

504505
for (auto &rootDeviceEnvironment : deviceFactory->rootDevices[0]->getExecutionEnvironment()->rootDeviceEnvironments) {
505-
rootDeviceEnvironment->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
506506
REQUIRE_FULL_BLITTER_OR_SKIP(rootDeviceEnvironment->getHardwareInfo());
507507
}
508508

opencl/test/unit_test/context/context_tests.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -549,6 +549,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, ContextCreateTests, givenLocalMemoryAllocationWhenB
549549
DebugManagerStateRestore restore;
550550
DebugManager.flags.EnableLocalMemory.set(true);
551551
DebugManager.flags.ForceLocalMemoryAccessMode.set(static_cast<int32_t>(LocalMemoryAccessMode::Default));
552+
553+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
554+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
552555
UltClDeviceFactory deviceFactory{1, 2};
553556

554557
ClDevice *devicesToTest[] = {deviceFactory.rootDevices[0], deviceFactory.subDevices[0], deviceFactory.subDevices[1]};

opencl/test/unit_test/device/device_tests.cpp

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ TEST_F(DeviceTest, givenDeviceWhenEngineIsCreatedThenSetInitialValueForTag) {
8686
TEST_F(DeviceTest, givenDeviceWhenAskedForSpecificEngineThenReturnIt) {
8787
auto hwInfo = *defaultHwInfo;
8888
hwInfo.featureTable.ftrCCSNode = true;
89+
hwInfo.capabilityTable.blitterOperationsSupported = true;
8990

9091
MockClDevice mockClDevice{MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo, 0)};
9192

@@ -103,14 +104,6 @@ TEST_F(DeviceTest, givenDeviceWhenAskedForSpecificEngineThenReturnIt) {
103104
EXPECT_THROW(mockClDevice.getEngine(aub_stream::ENGINE_VCS, EngineUsage::Regular), std::exception);
104105
}
105106

106-
TEST_F(DeviceTest, givenDeviceWhenAskedForEngineWithValidIndexThenReturnIt) {
107-
auto &engines = HwHelper::get(defaultHwInfo->platform.eRenderCoreFamily).getGpgpuEngineInstances(*defaultHwInfo);
108-
for (uint32_t i = 0; i < engines.size(); i++) {
109-
auto &deviceEngine = pDevice->getEngine(i);
110-
EXPECT_EQ(deviceEngine.osContext->getEngineType(), engines[i].first);
111-
}
112-
}
113-
114107
TEST_F(DeviceTest, givenDebugVariableToAlwaysChooseEngineZeroWhenNotExistingEngineSelectedThenIndexZeroEngineIsReturned) {
115108
DebugManagerStateRestore restore;
116109
DebugManager.flags.OverrideInvalidEngineWithDefault.set(true);
@@ -323,9 +316,10 @@ TEST(DeviceCreation, givenDefaultHwCsrInDebugVarsWhenDeviceIsCreatedThenIsSimula
323316
}
324317

325318
TEST(DeviceCreation, givenDeviceWhenItIsCreatedThenOsContextIsRegistredInMemoryManager) {
326-
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(nullptr));
319+
auto hwInfo = *defaultHwInfo;
320+
hwInfo.capabilityTable.blitterOperationsSupported = true;
321+
auto device = std::unique_ptr<MockDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(&hwInfo));
327322
auto memoryManager = device->getMemoryManager();
328-
auto &hwInfo = device->getHardwareInfo();
329323
auto numEnginesForDevice = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo).size();
330324
if (device->getNumGenericSubDevices() > 1) {
331325
numEnginesForDevice *= device->getNumGenericSubDevices();
@@ -346,6 +340,7 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachOsContextHasU
346340
executionEnvironment->prepareRootDeviceEnvironments(numDevices);
347341
for (auto i = 0u; i < numDevices; i++) {
348342
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
343+
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
349344
}
350345

351346
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
@@ -421,8 +416,9 @@ TEST(DeviceCreation, givenMultiRootDeviceWhenTheyAreCreatedThenEachDeviceHasSepe
421416
executionEnvironment->prepareRootDeviceEnvironments(numDevices);
422417
for (auto i = 0u; i < executionEnvironment->rootDeviceEnvironments.size(); i++) {
423418
executionEnvironment->rootDeviceEnvironments[i]->setHwInfo(defaultHwInfo.get());
419+
executionEnvironment->rootDeviceEnvironments[i]->getMutableHardwareInfo()->capabilityTable.blitterOperationsSupported = true;
424420
}
425-
auto hwInfo = *defaultHwInfo;
421+
auto hwInfo = *executionEnvironment->rootDeviceEnvironments[0]->getHardwareInfo();
426422
const auto &numGpgpuEngines = HwHelper::get(hwInfo.platform.eRenderCoreFamily).getGpgpuEngineInstances(hwInfo).size();
427423
auto device1 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 0u));
428424
auto device2 = std::unique_ptr<MockDevice>(Device::create<MockDevice>(executionEnvironment, 1u));

opencl/test/unit_test/device/get_device_info_tests.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,8 @@ using GetDeviceInfoQueueFamilyTest = ::testing::Test;
725725

726726
HWTEST_F(GetDeviceInfoQueueFamilyTest, givenSingleDeviceWhenInitializingCapsThenReturnCorrectFamilies) {
727727
auto raiiHwHelper = MockHwHelper<FamilyType, 3, 1>::overrideHwHelper();
728+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
729+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
728730
UltClDeviceFactory deviceFactory{1, 0};
729731
ClDevice &clDevice = *deviceFactory.rootDevices[0];
730732
size_t paramRetSize{};
@@ -746,6 +748,8 @@ HWTEST_F(GetDeviceInfoQueueFamilyTest, givenSingleDeviceWhenInitializingCapsThen
746748

747749
HWTEST_F(GetDeviceInfoQueueFamilyTest, givenSubDeviceWhenInitializingCapsThenReturnCorrectFamilies) {
748750
auto raiiHwHelper = MockHwHelper<FamilyType, 3, 1>::overrideHwHelper();
751+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
752+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
749753
UltClDeviceFactory deviceFactory{1, 2};
750754
ClDevice &clDevice = *deviceFactory.subDevices[1];
751755
size_t paramRetSize{};
@@ -776,6 +780,8 @@ HWTEST_F(GetDeviceInfoQueueFamilyTest, givenSubDeviceWithoutSupportedEngineWhenI
776780
mockHwHelper.disableEngineSupportOnSubDevice = 0b10; // subdevice 1
777781
mockHwHelper.disabledSubDeviceEngineType = aub_stream::EngineType::ENGINE_BCS;
778782

783+
VariableBackup<HardwareInfo> backupHwInfo(defaultHwInfo.get());
784+
defaultHwInfo->capabilityTable.blitterOperationsSupported = true;
779785
UltClDeviceFactory deviceFactory{1, 2};
780786
ClDevice &clDevice0 = *deviceFactory.subDevices[0];
781787
ClDevice &clDevice1 = *deviceFactory.subDevices[1];

0 commit comments

Comments
 (0)