From b8723458e4fc54aa78330dceea2aecce8a9a60b6 Mon Sep 17 00:00:00 2001 From: Kamil Kopryk Date: Mon, 10 Feb 2025 18:01:10 +0000 Subject: [PATCH] test: update ults to respect minimal simd Signed-off-by: Kamil Kopryk --- .../api/cl_create_kernels_in_program_tests.inl | 4 +++- opencl/test/unit_test/device/device_caps_tests.cpp | 3 ++- opencl/test/unit_test/kernel/kernel_tests.cpp | 13 ++++++++----- .../test/unit_test/program/printf_handler_tests.cpp | 2 +- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/opencl/test/unit_test/api/cl_create_kernels_in_program_tests.inl b/opencl/test/unit_test/api/cl_create_kernels_in_program_tests.inl index d862b22feb..27b7d26d18 100644 --- a/opencl/test/unit_test/api/cl_create_kernels_in_program_tests.inl +++ b/opencl/test/unit_test/api/cl_create_kernels_in_program_tests.inl @@ -23,7 +23,9 @@ struct ClCreateKernelsInProgramTests : public ApiTests { ApiTests::SetUp(); constexpr auto numBits = is32bit ? Elf::EI_CLASS_32 : Elf::EI_CLASS_64; - auto zebinData = std::make_unique>(pDevice->getHardwareInfo(), 16); + auto simd = std::max(16u, pDevice->getGfxCoreHelper().getMinimalSIMDSize()); + + auto zebinData = std::make_unique>(pDevice->getHardwareInfo(), static_cast(simd)); const auto &src = zebinData->storage; const auto &binarySize = src.size(); diff --git a/opencl/test/unit_test/device/device_caps_tests.cpp b/opencl/test/unit_test/device/device_caps_tests.cpp index 07ade3861b..63ddb0cf88 100644 --- a/opencl/test/unit_test/device/device_caps_tests.cpp +++ b/opencl/test/unit_test/device/device_caps_tests.cpp @@ -1688,7 +1688,8 @@ HWTEST2_F(DeviceGetCapsTest, givenSysInfoWhenDeviceCreatedThenMaxWorkGroupSizeIs auto &gfxCoreHelper = device->getGfxCoreHelper(); auto minSimd = gfxCoreHelper.getMinimalSIMDSize(); - size_t expectedWGSize = (mySysInfo.ThreadCount / mySysInfo.DualSubSliceCount) * minSimd; + uint32_t expectedWGSize = (mySysInfo.ThreadCount / mySysInfo.DualSubSliceCount) * minSimd; + expectedWGSize = gfxCoreHelper.overrideMaxWorkGroupSize(expectedWGSize); EXPECT_EQ(expectedWGSize, device->sharedDeviceInfo.maxWorkGroupSize); } diff --git a/opencl/test/unit_test/kernel/kernel_tests.cpp b/opencl/test/unit_test/kernel/kernel_tests.cpp index be1c31d834..354a85be99 100644 --- a/opencl/test/unit_test/kernel/kernel_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_tests.cpp @@ -2861,8 +2861,8 @@ TEST_F(KernelCrossThreadTests, WhenKernelIsInitializedThenEnqueuedMaxWorkGroupSi } TEST_F(KernelCrossThreadTests, WhenKernelIsInitializedThenDataParameterSimdSizeIsCorrect) { - pKernelInfo->kernelDescriptor.payloadMappings.implicitArgs.simdSize = 16; - pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 16; + pKernelInfo->kernelDescriptor.payloadMappings.implicitArgs.simdSize = pClDevice->getGfxCoreHelper().getMinimalSIMDSize(); + pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = pClDevice->getGfxCoreHelper().getMinimalSIMDSize(); MockKernel kernel(program.get(), *pKernelInfo, *pClDevice); ASSERT_EQ(CL_SUCCESS, kernel.initialize()); @@ -3821,7 +3821,7 @@ struct KernelLargeGrfTests : Test { }; HWTEST2_F(KernelLargeGrfTests, GivenLargeGrfAndSimdSizeWhenGettingMaxWorkGroupSizeThenCorrectValueReturned, IsAtLeastXeHpCore) { - pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 16; + pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = pClDevice->getGfxCoreHelper().getMinimalSIMDSize(); pKernelInfo->kernelDescriptor.kernelAttributes.crossThreadDataSize = 4; pKernelInfo->kernelDescriptor.payloadMappings.implicitArgs.maxWorkGroupSize = 0; { @@ -3838,8 +3838,11 @@ HWTEST2_F(KernelLargeGrfTests, GivenLargeGrfAndSimdSizeWhenGettingMaxWorkGroupSi pKernelInfo->kernelDescriptor.kernelAttributes.numGrfRequired = GrfConfig::largeGrfNumber; EXPECT_EQ(CL_SUCCESS, kernel.initialize()); - EXPECT_EQ(pDevice->getDeviceInfo().maxWorkGroupSize >> 1, *kernel.maxWorkGroupSizeForCrossThreadData); - EXPECT_EQ(pDevice->getDeviceInfo().maxWorkGroupSize >> 1, kernel.maxKernelWorkGroupSize); + if (pKernelInfo->kernelDescriptor.kernelAttributes.simdSize != 32) { + + EXPECT_EQ(pDevice->getDeviceInfo().maxWorkGroupSize >> 1, *kernel.maxWorkGroupSizeForCrossThreadData); + EXPECT_EQ(pDevice->getDeviceInfo().maxWorkGroupSize >> 1, kernel.maxKernelWorkGroupSize); + } } { diff --git a/opencl/test/unit_test/program/printf_handler_tests.cpp b/opencl/test/unit_test/program/printf_handler_tests.cpp index 4bda734098..91b7f4b896 100644 --- a/opencl/test/unit_test/program/printf_handler_tests.cpp +++ b/opencl/test/unit_test/program/printf_handler_tests.cpp @@ -92,7 +92,7 @@ TEST_F(PrintfHandlerTests, givenKernelWithImplicitArgsWhenPreparingPrintfHandler auto pKernelInfo = std::make_unique(); pKernelInfo->setPrintfSurface(sizeof(uintptr_t), 0); - pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = 16; + pKernelInfo->kernelDescriptor.kernelAttributes.simdSize = device->getGfxCoreHelper().getMinimalSIMDSize(); pKernelInfo->kernelDescriptor.kernelAttributes.flags.requiresImplicitArgs = true; MockProgram program{&context, false, toClDeviceVector(*device)};