@@ -1256,23 +1256,26 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau
12561256
12571257 kernel.setGroupSize (4 , 1 , 1 );
12581258 ze_group_count_t groupCount{8 , 1 , 1 };
1259- auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1260- auto result = pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
1261- ASSERT_EQ (ZE_RESULT_SUCCESS, result);
12621259
12631260 auto &kernelAttributes = kernel.immutableData .kernelDescriptor ->kernelAttributes ;
12641261 kernelAttributes.flags .usesSyncBuffer = true ;
12651262 kernelAttributes.numGrfRequired = GrfConfig::DefaultGrfNumber;
12661263 bool isCooperative = true ;
1267- result = pCommandList->appendLaunchCooperativeKernel (kernel.toHandle (), &groupCount, nullptr , 0 , nullptr );
1264+ auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1265+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
1266+ auto result = pCommandList->appendLaunchCooperativeKernel (kernel.toHandle (), &groupCount, nullptr , 0 , nullptr );
12681267 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
12691268
1269+ pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1270+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
12701271 result = pCommandList->appendLaunchKernelWithParams (kernel.toHandle (), &groupCount, nullptr , false , false , isCooperative);
12711272 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
12721273
12731274 {
12741275 VariableBackup<uint32_t > usesSyncBuffer{&kernelAttributes.flags .packed };
12751276 usesSyncBuffer = false ;
1277+ pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1278+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
12761279 result = pCommandList->appendLaunchKernelWithParams (kernel.toHandle (), &groupCount, nullptr , false , false , isCooperative);
12771280 EXPECT_EQ (ZE_RESULT_SUCCESS, result);
12781281 }
@@ -1281,6 +1284,8 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau
12811284 uint32_t maximalNumberOfWorkgroupsAllowed;
12821285 kernel.suggestMaxCooperativeGroupCount (&maximalNumberOfWorkgroupsAllowed);
12831286 groupCountX = maximalNumberOfWorkgroupsAllowed + 1 ;
1287+ pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1288+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
12841289 result = pCommandList->appendLaunchKernelWithParams (kernel.toHandle (), &groupCount, nullptr , false , false , isCooperative);
12851290 EXPECT_EQ (ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
12861291 }
@@ -1292,9 +1297,7 @@ HWTEST2_F(CommandListAppendLaunchKernel, givenKernelUsingSyncBufferWhenAppendLau
12921297 }
12931298}
12941299
1295- using Platforms = IsAtLeastProduct<IGFX_SKYLAKE>;
1296-
1297- HWTEST2_F (CommandListAppendLaunchKernel, whenUpdateStreamPropertiesIsCalledThenRequiredStateAndFinalStateAreCorrectlySet, Platforms) {
1300+ HWTEST2_F (CommandListAppendLaunchKernel, whenUpdateStreamPropertiesIsCalledThenRequiredStateAndFinalStateAreCorrectlySet, SklPlusMatcher) {
12981301 Mock<::L0::Kernel> kernel;
12991302 auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr ));
13001303 kernel.module = pMockModule.get ();
@@ -1318,5 +1321,54 @@ HWTEST2_F(CommandListAppendLaunchKernel, whenUpdateStreamPropertiesIsCalledThenR
13181321 EXPECT_EQ (expectedDisableOverdispatch, pCommandList->finalStreamState .frontEndState .disableOverdispatch .value );
13191322}
13201323
1324+ HWTEST2_F (CommandListAppendLaunchKernel, givenCooperativeKernelWhenAppendLaunchCooperativeKernelIsCalledThenCommandListTypeIsProperlySet, SklPlusMatcher) {
1325+ createKernel ();
1326+ kernel->setGroupSize (4 , 1 , 1 );
1327+ ze_group_count_t groupCount{8 , 1 , 1 };
1328+
1329+ auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1330+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
1331+ bool isCooperative = false ;
1332+ auto result = pCommandList->appendLaunchKernelWithParams (kernel->toHandle (), &groupCount, nullptr , false , false , isCooperative);
1333+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
1334+ EXPECT_TRUE (pCommandList->containsAnyKernel );
1335+ EXPECT_FALSE (pCommandList->containsCooperativeKernelsFlag );
1336+
1337+ pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1338+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
1339+ isCooperative = true ;
1340+ result = pCommandList->appendLaunchKernelWithParams (kernel->toHandle (), &groupCount, nullptr , false , false , isCooperative);
1341+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
1342+ EXPECT_TRUE (pCommandList->containsAnyKernel );
1343+ EXPECT_TRUE (pCommandList->containsCooperativeKernelsFlag );
1344+ }
1345+
1346+ HWTEST2_F (CommandListAppendLaunchKernel, givenCooperativeAndNonCooperativeKernelsWhenAppendLaunchCooperativeKernelIsCalledThenReturnError, SklPlusMatcher) {
1347+ Mock<::L0::Kernel> kernel;
1348+ auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr ));
1349+ kernel.module = pMockModule.get ();
1350+
1351+ kernel.setGroupSize (4 , 1 , 1 );
1352+ ze_group_count_t groupCount{8 , 1 , 1 };
1353+
1354+ auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1355+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
1356+ bool isCooperative = false ;
1357+ auto result = pCommandList->appendLaunchKernelWithParams (kernel.toHandle (), &groupCount, nullptr , false , false , isCooperative);
1358+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
1359+ isCooperative = true ;
1360+ result = pCommandList->appendLaunchKernelWithParams (kernel.toHandle (), &groupCount, nullptr , false , false , isCooperative);
1361+ EXPECT_EQ (ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
1362+
1363+ pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
1364+ pCommandList->initialize (device, NEO::EngineGroupType::Compute, 0u );
1365+ isCooperative = true ;
1366+ result = pCommandList->appendLaunchKernelWithParams (kernel.toHandle (), &groupCount, nullptr , false , false , isCooperative);
1367+ EXPECT_EQ (ZE_RESULT_SUCCESS, result);
1368+ isCooperative = false ;
1369+ result = pCommandList->appendLaunchKernelWithParams (kernel.toHandle (), &groupCount, nullptr , false , false , isCooperative);
1370+ EXPECT_EQ (ZE_RESULT_ERROR_INVALID_ARGUMENT, result);
1371+ }
1372+
13211373} // namespace ult
13221374} // namespace L0
0 commit comments