@@ -1651,6 +1651,53 @@ HWTEST2_F(KernelMaxNumSubgroupsTests, givenLargeGrfAndSimdSmallerThan32WhenCalcu
1651
1651
EXPECT_EQ (static_cast <uint32_t >(this ->module ->getDevice ()->getNEODevice ()->getDeviceInfo ().maxWorkGroupSize ) / maxSubgroupSize, maxNumSubgroups * 2 );
1652
1652
}
1653
1653
1654
+ HWTEST2_F (KernelMaxNumSubgroupsTests, givenLargeGrfAndSimdSmallerThan32WhenPassingKernelMaxGroupSizePropertiesStructToGetPropertiesThenHalfDeviceMaxGroupSizeIsReturned, IsWithinXeGfxFamily) {
1655
+ std::unique_ptr<MockImmutableData> mockKernelImmData = std::make_unique<MockImmutableData>(0u );
1656
+
1657
+ auto kernelDescriptor = mockKernelImmData->kernelDescriptor ;
1658
+ kernelDescriptor->kernelAttributes .simdSize = 16 ;
1659
+ kernelDescriptor->kernelAttributes .numGrfRequired = GrfConfig::largeGrfNumber;
1660
+
1661
+ createModuleFromMockBinary (0u , false , mockKernelImmData.get ());
1662
+
1663
+ auto mockKernel = std::make_unique<MockKernel>(this ->module .get ());
1664
+
1665
+ ze_kernel_desc_t kernelDesc{ZE_STRUCTURE_TYPE_KERNEL_DESC};
1666
+ mockKernel->initialize (&kernelDesc);
1667
+
1668
+ ze_kernel_properties_t kernelProperties = {};
1669
+ kernelProperties.stype = ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES;
1670
+ ze_kernel_max_group_size_properties_ext_t maxGroupSizeProperties = {};
1671
+ maxGroupSizeProperties.stype = ZE_STRUCTURE_TYPE_KERNEL_MAX_GROUP_SIZE_EXT_PROPERTIES;
1672
+
1673
+ kernelProperties.pNext = &maxGroupSizeProperties;
1674
+
1675
+ ze_result_t res = mockKernel->getProperties (&kernelProperties);
1676
+ EXPECT_EQ (ZE_RESULT_SUCCESS, res);
1677
+ EXPECT_EQ (static_cast <uint32_t >(this ->module ->getDevice ()->getNEODevice ()->getDeviceInfo ().maxWorkGroupSize ), maxGroupSizeProperties.maxGroupSize * 2 );
1678
+ }
1679
+
1680
+ TEST_F (KernelPropertiesTests, whenPassingKernelMaxGroupSizePropertiesStructToGetPropertiesThenMaxGroupSizeIsReturned) {
1681
+ auto &kernelDescriptor = const_cast <KernelDescriptor &>(kernel->getKernelDescriptor ());
1682
+ kernelDescriptor.kernelAttributes .numGrfRequired = GrfConfig::defaultGrfNumber;
1683
+ kernelDescriptor.kernelAttributes .simdSize = 16 ;
1684
+
1685
+ ze_kernel_properties_t kernelProperties = {};
1686
+ kernelProperties.stype = ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES;
1687
+
1688
+ ze_kernel_max_group_size_properties_ext_t maxGroupSizeProperties = {};
1689
+ maxGroupSizeProperties.stype = ZE_STRUCTURE_TYPE_KERNEL_MAX_GROUP_SIZE_EXT_PROPERTIES;
1690
+
1691
+ kernelProperties.pNext = &maxGroupSizeProperties;
1692
+
1693
+ ze_result_t res = kernel->getProperties (&kernelProperties);
1694
+ EXPECT_EQ (ZE_RESULT_SUCCESS, res);
1695
+
1696
+ auto &gfxCoreHelper = module ->getDevice ()->getGfxCoreHelper ();
1697
+ uint32_t maxKernelWorkGroupSize = gfxCoreHelper.adjustMaxWorkGroupSize (kernelDescriptor.kernelAttributes .numGrfRequired , kernelDescriptor.kernelAttributes .simdSize , false , static_cast <uint32_t >(this ->module ->getMaxGroupSize (kernelDescriptor)));
1698
+ EXPECT_EQ (maxKernelWorkGroupSize, maxGroupSizeProperties.maxGroupSize );
1699
+ }
1700
+
1654
1701
TEST_F (KernelPropertiesTests, whenPassingPreferredGroupSizeStructToGetPropertiesThenPreferredMultipleIsReturned) {
1655
1702
ze_kernel_properties_t kernelProperties = {};
1656
1703
kernelProperties.stype = ZE_STRUCTURE_TYPE_KERNEL_PROPERTIES;
0 commit comments