@@ -906,6 +906,74 @@ HWTEST_F(CommandQueueTests, givenEngineUsageHintSetWithInvalidValueWhenCreatingC
906
906
delete pCmdQ;
907
907
}
908
908
909
+ HWTEST_F (CommandQueueTests, givenNodeOrdinalSetWithRenderEngineWhenCreatingCommandQueueWithPropertiesWhereComputeEngineSetThenProperEngineUsed) {
910
+ DebugManagerStateRestore restore;
911
+ auto forcedEngine = EngineHelpers::remapEngineTypeToHwSpecific (aub_stream::EngineType::ENGINE_RCS, *defaultHwInfo);
912
+ DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(forcedEngine));
913
+
914
+ auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get ()));
915
+ MockContext context (pDevice.get ());
916
+
917
+ cl_uint expectedEngineIndex = 0u ;
918
+
919
+ cl_int retVal = CL_SUCCESS;
920
+ auto userPropertiesEngineGroupType = static_cast <cl_uint>(EngineGroupType::Compute);
921
+ cl_uint userPropertiesEngineIndex = 2u ;
922
+
923
+ cl_queue_properties propertiesCooperativeQueue[] = {CL_QUEUE_FAMILY_INTEL, userPropertiesEngineGroupType, CL_QUEUE_INDEX_INTEL, userPropertiesEngineIndex, 0 };
924
+
925
+ const HwHelper &hwHelper = HwHelper::get (defaultHwInfo->platform .eRenderCoreFamily );
926
+ EXPECT_NE (hwHelper.getEngineGroupType (static_cast <aub_stream::EngineType>(forcedEngine), EngineUsage::Regular, *defaultHwInfo),
927
+ static_cast <EngineGroupType>(userPropertiesEngineGroupType));
928
+ EXPECT_NE (expectedEngineIndex, userPropertiesEngineIndex);
929
+
930
+ auto pCmdQ = CommandQueue::create (
931
+ &context,
932
+ pDevice.get (),
933
+ propertiesCooperativeQueue,
934
+ false ,
935
+ retVal);
936
+ EXPECT_EQ (CL_SUCCESS, retVal);
937
+ EXPECT_NE (nullptr , pCmdQ);
938
+ EXPECT_EQ (forcedEngine, pCmdQ->getGpgpuEngine ().getEngineType ());
939
+ delete pCmdQ;
940
+ }
941
+
942
+ HWTEST_F (CommandQueueTests, givenNodeOrdinalSetWithCcsEngineWhenCreatingCommandQueueWithPropertiesAndRegularCcsEngineNotExistThenEngineNotForced) {
943
+ DebugManagerStateRestore restore;
944
+ auto defaultEngine = EngineHelpers::remapEngineTypeToHwSpecific (aub_stream::EngineType::ENGINE_RCS, *defaultHwInfo);
945
+ DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(defaultEngine));
946
+
947
+ auto pDevice = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get ()));
948
+ MockContext context (pDevice.get ());
949
+
950
+ cl_int retVal = CL_SUCCESS;
951
+
952
+ cl_queue_properties propertiesCooperativeQueue[] = {CL_QUEUE_FAMILY_INTEL, 0 , CL_QUEUE_INDEX_INTEL, 0 , 0 };
953
+
954
+ struct FakeHwHelper : HwHelperHw<FamilyType> {
955
+ EngineGroupType getEngineGroupType (aub_stream::EngineType engineType, EngineUsage engineUsage, const HardwareInfo &hwInfo) const override {
956
+ return EngineGroupType::RenderCompute;
957
+ }
958
+ };
959
+ RAIIHwHelperFactory<FakeHwHelper> overrideHwHelper{defaultHwInfo->platform .eRenderCoreFamily };
960
+
961
+ auto forcedEngine = EngineHelpers::remapEngineTypeToHwSpecific (aub_stream::EngineType::ENGINE_CCS, *defaultHwInfo);
962
+ DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(forcedEngine));
963
+
964
+ auto pCmdQ = CommandQueue::create (
965
+ &context,
966
+ pDevice.get (),
967
+ propertiesCooperativeQueue,
968
+ false ,
969
+ retVal);
970
+ EXPECT_EQ (CL_SUCCESS, retVal);
971
+ EXPECT_NE (nullptr , pCmdQ);
972
+ EXPECT_NE (forcedEngine, pCmdQ->getGpgpuEngine ().getEngineType ());
973
+ EXPECT_EQ (defaultEngine, pCmdQ->getGpgpuEngine ().getEngineType ());
974
+ delete pCmdQ;
975
+ }
976
+
909
977
struct WaitForQueueCompletionTests : public ::testing::Test {
910
978
template <typename Family>
911
979
struct MyCmdQueue : public CommandQueueHw <Family> {
@@ -2506,16 +2574,17 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenNotInitializedRcsOsContextWhenC
2506
2574
VariableBackup<HardwareInfo> backupHwInfo (defaultHwInfo.get ());
2507
2575
defaultHwInfo->capabilityTable .blitterOperationsSupported = true ;
2508
2576
DebugManagerStateRestore restore{};
2509
- DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(aub_stream::EngineType::ENGINE_RCS));
2510
2577
DebugManager.flags .DeferOsContextInitialization .set (1 );
2578
+ DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(aub_stream::EngineType::ENGINE_CCS));
2511
2579
2512
2580
auto raiiHwHelper = overrideHwHelper<FamilyType, MockHwHelper<FamilyType, 1 , 1 , 1 >>();
2513
2581
MockContext context{};
2514
2582
cl_command_queue_properties properties[5 ] = {};
2515
2583
2516
- OsContext &osContext = *context.getDevice (0 )->getEngine (aub_stream::ENGINE_CCS , EngineUsage::Regular).osContext ;
2584
+ OsContext &osContext = *context.getDevice (0 )->getEngine (aub_stream::ENGINE_RCS , EngineUsage::Regular).osContext ;
2517
2585
EXPECT_FALSE (osContext.isInitialized ());
2518
2586
2587
+ DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(aub_stream::EngineType::ENGINE_RCS));
2519
2588
const auto ccsFamilyIndex = static_cast <cl_uint>(context.getDevice (0 )->getDevice ().getEngineGroupIndexFromEngineGroupType (EngineGroupType::Compute));
2520
2589
fillProperties (properties, ccsFamilyIndex, 0 );
2521
2590
MockCommandQueueHw<FamilyType> queue (&context, context.getDevice (0 ), properties);
@@ -2527,16 +2596,17 @@ HWTEST_F(CommandQueueOnSpecificEngineTests, givenNotInitializedCcsOsContextWhenC
2527
2596
VariableBackup<HardwareInfo> backupHwInfo (defaultHwInfo.get ());
2528
2597
defaultHwInfo->capabilityTable .blitterOperationsSupported = true ;
2529
2598
DebugManagerStateRestore restore{};
2530
- DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(aub_stream::EngineType::ENGINE_CCS ));
2599
+ DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(aub_stream::EngineType::ENGINE_RCS ));
2531
2600
DebugManager.flags .DeferOsContextInitialization .set (1 );
2532
2601
2533
2602
auto raiiHwHelper = overrideHwHelper<FamilyType, MockHwHelper<FamilyType, 1 , 1 , 1 >>();
2534
2603
MockContext context{};
2535
2604
cl_command_queue_properties properties[5 ] = {};
2536
2605
2537
- OsContext &osContext = *context.getDevice (0 )->getEngine (aub_stream::ENGINE_RCS , EngineUsage::Regular).osContext ;
2606
+ OsContext &osContext = *context.getDevice (0 )->getEngine (aub_stream::ENGINE_CCS , EngineUsage::Regular).osContext ;
2538
2607
EXPECT_FALSE (osContext.isInitialized ());
2539
2608
2609
+ DebugManager.flags .NodeOrdinal .set (static_cast <int32_t >(aub_stream::EngineType::ENGINE_CCS));
2540
2610
const auto rcsFamilyIndex = static_cast <cl_uint>(context.getDevice (0 )->getDevice ().getEngineGroupIndexFromEngineGroupType (EngineGroupType::RenderCompute));
2541
2611
fillProperties (properties, rcsFamilyIndex, 0 );
2542
2612
MockCommandQueueHw<FamilyType> queue (&context, context.getDevice (0 ), properties);
0 commit comments