Update ULTs

Related-To: NEO-5368

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
This commit is contained in:
Filip Hazubski
2021-01-14 11:34:49 +00:00
committed by Compute-Runtime-Automation
parent 90f96f083c
commit 070c6cdf2f
7 changed files with 36 additions and 48 deletions

View File

@@ -457,7 +457,7 @@ HWTEST_F(DispatchWalkerTest, GivenNoLocalWorkSizeAndNdOnWhenDispatchingWalkerThe
ASSERT_EQ(CL_SUCCESS, kernel.initialize());
size_t globalOffsets[3] = {0, 0, 0};
size_t workItems[3] = {2, 5, 10};
size_t workItems[3] = {2, 3, 5};
cl_uint dimensions = 3;
DispatchInfo dispatchInfo(pClDevice, const_cast<MockKernel *>(&kernel), dimensions, workItems, nullptr, globalOffsets);
MultiDispatchInfo multiDispatchInfo;
@@ -473,8 +473,8 @@ HWTEST_F(DispatchWalkerTest, GivenNoLocalWorkSizeAndNdOnWhenDispatchingWalkerThe
nullptr,
CL_COMMAND_NDRANGE_KERNEL);
EXPECT_EQ(2u, *kernel.kernelDeviceInfos[rootDeviceIndex].localWorkSizeX);
EXPECT_EQ(5u, *kernel.kernelDeviceInfos[rootDeviceIndex].localWorkSizeY);
EXPECT_EQ(10u, *kernel.kernelDeviceInfos[rootDeviceIndex].localWorkSizeZ);
EXPECT_EQ(3u, *kernel.kernelDeviceInfos[rootDeviceIndex].localWorkSizeY);
EXPECT_EQ(5u, *kernel.kernelDeviceInfos[rootDeviceIndex].localWorkSizeZ);
}
HWTEST_F(DispatchWalkerTest, GivenNoLocalWorkSizeAndSquaredAlgorithmWhenDispatchingWalkerThenLwsIsCorrect) {

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2020 Intel Corporation
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -43,7 +43,7 @@ TEST_F(EnqueueKernelTest, GivenNullKernelWhenEnqueuingKernelThenInvalidKernelErr
TEST_F(EnqueueKernelTest, givenKernelWhenAllArgsAreSetThenClEnqueueNDRangeKernelReturnsSuccess) {
const size_t n = 512;
size_t globalWorkSize[3] = {n, 1, 1};
size_t localWorkSize[3] = {256, 1, 1};
size_t localWorkSize[3] = {64, 1, 1};
cl_int retVal = CL_SUCCESS;
CommandQueue *pCmdQ2 = createCommandQueue(pClDevice);
@@ -239,7 +239,7 @@ TEST_F(clEnqueueNDCountKernelTests, GivenQueueIncapableWhenEnqueuingNDCountKerne
TEST_F(EnqueueKernelTest, givenKernelWhenAllArgsAreSetThenClEnqueueNDCountKernelINTELReturnsSuccess) {
const size_t n = 512;
size_t workgroupCount[3] = {2, 1, 1};
size_t localWorkSize[3] = {256, 1, 1};
size_t localWorkSize[3] = {64, 1, 1};
cl_int retVal = CL_SUCCESS;
CommandQueue *pCmdQ2 = createCommandQueue(pClDevice);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -65,19 +65,19 @@ TEST_F(EnqueueKernelRequiredWorkSize, GivenUnspecifiedWorkGroupSizeWhenEnqeueing
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeX, 8u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeY, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeZ, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeY, 2u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeZ, 2u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeX, 8u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeY, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeZ, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeY, 2u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeZ, 2u);
}
// Fully specified
TEST_F(EnqueueKernelRequiredWorkSize, GivenRequiredWorkGroupSizeWhenEnqeueingKernelThenLwsIsSetCorrectly) {
size_t globalWorkOffset[3] = {0, 0, 0};
size_t globalWorkSize[3] = {32, 32, 32};
size_t localWorkSize[3] = {8, 4, 4};
size_t localWorkSize[3] = {8, 2, 2};
auto retVal = pCmdQ->enqueueKernel(
pKernel,
@@ -92,12 +92,12 @@ TEST_F(EnqueueKernelRequiredWorkSize, GivenRequiredWorkGroupSizeWhenEnqeueingKer
EXPECT_EQ(CL_SUCCESS, retVal);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeX, 8u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeY, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeZ, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeY, 2u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].enqueuedLocalWorkSizeZ, 2u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeX, 8u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeY, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeZ, 4u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeY, 2u);
EXPECT_EQ(*pKernel->kernelDeviceInfos[rootDeviceIndex].localWorkSizeZ, 2u);
}
// Underspecified. Won't permit.

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -421,7 +421,7 @@ HWTEST_F(GetSizeRequiredBufferTest, GivenHelloWorldKernelWhenEnqueingKernelThenH
auto iohBefore = pIOH->getUsed();
auto sshBefore = pSSH->getUsed();
size_t workSize[] = {256};
size_t workSize[] = {64};
auto retVal = EnqueueKernelHelper<>::enqueueKernel(
pCmdQ,
KernelFixture::pKernel,
@@ -460,7 +460,7 @@ HWTEST_F(GetSizeRequiredBufferTest, GivenKernelWithSimpleArgWhenEnqueingKernelTh
auto iohBefore = pIOH->getUsed();
auto sshBefore = pSSH->getUsed();
size_t workSize[] = {256};
size_t workSize[] = {64};
auto retVal = EnqueueKernelHelper<>::enqueueKernel(
pCmdQ,
KernelFixture::pKernel,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -242,7 +242,7 @@ TEST_F(DispatchInfoBuilderTest, WhenGettingElwsThenCorrectValuesAreReturned) {
}
TEST_F(DispatchInfoBuilderTest, WhenGettingLwsThenCorrectValuesAreReturned) {
DispatchInfoBuilder<SplitDispatch::Dim::d3D, SplitDispatch::SplitMode::NoSplit> *diBuilder = new DispatchInfoBuilder<SplitDispatch::Dim::d3D, SplitDispatch::SplitMode::NoSplit>(*pClDevice);
auto diBuilder = std::make_unique<DispatchInfoBuilder<SplitDispatch::Dim::d3D, SplitDispatch::SplitMode::NoSplit>>(*pClDevice);
ASSERT_NE(nullptr, diBuilder);
MultiDispatchInfo mdi0, mdi1, mdi2, mdi3;
@@ -253,46 +253,31 @@ TEST_F(DispatchInfoBuilderTest, WhenGettingLwsThenCorrectValuesAreReturned) {
EXPECT_TRUE(mdi0.empty());
diBuilder->setKernel(pKernel);
diBuilder->setDispatchGeometry(Vec3<size_t>(16, 0, 0), Vec3<size_t>(0, 0, 0), Vec3<size_t>(0, 0, 0));
diBuilder->setDispatchGeometry(Vec3<size_t>(4, 0, 0), Vec3<size_t>(0, 0, 0), Vec3<size_t>(0, 0, 0));
diBuilder->bake(mdi1);
for (auto &dispatchInfo : mdi1) {
EXPECT_EQ(16u, dispatchInfo.getLocalWorkgroupSize().x);
EXPECT_EQ(4u, dispatchInfo.getLocalWorkgroupSize().x);
EXPECT_EQ(1u, dispatchInfo.getLocalWorkgroupSize().y);
EXPECT_EQ(1u, dispatchInfo.getLocalWorkgroupSize().z);
}
diBuilder->setKernel(pKernel);
diBuilder->setDispatchGeometry(Vec3<size_t>(16, 16, 0), Vec3<size_t>(0, 0, 0), Vec3<size_t>(0, 0, 0));
diBuilder->setDispatchGeometry(Vec3<size_t>(4, 4, 0), Vec3<size_t>(0, 0, 0), Vec3<size_t>(0, 0, 0));
diBuilder->bake(mdi2);
for (auto &dispatchInfo : mdi2) {
EXPECT_EQ(16u, dispatchInfo.getLocalWorkgroupSize().x);
EXPECT_EQ(16u, dispatchInfo.getLocalWorkgroupSize().y);
EXPECT_EQ(4u, dispatchInfo.getLocalWorkgroupSize().x);
EXPECT_EQ(4u, dispatchInfo.getLocalWorkgroupSize().y);
EXPECT_EQ(1u, dispatchInfo.getLocalWorkgroupSize().z);
}
size_t expectedResult[] = {16u, 16u, 1u};
const auto &hwInfo = pDevice->getHardwareInfo();
auto isSimulation = pDevice->isSimulation();
EXPECT_FALSE(isSimulation);
auto &hwHelper = HwHelper::get(hwInfo.platform.eRenderCoreFamily);
if (hwHelper.isSpecialWorkgroupSizeRequired(hwInfo, isSimulation)) {
for (auto &result : expectedResult) {
result = 1u;
}
}
diBuilder->setKernel(pKernel);
diBuilder->setDispatchGeometry(Vec3<size_t>(16, 16, 16), Vec3<size_t>(0, 0, 0), Vec3<size_t>(0, 0, 0));
diBuilder->setDispatchGeometry(Vec3<size_t>(4, 4, 4), Vec3<size_t>(0, 0, 0), Vec3<size_t>(0, 0, 0));
diBuilder->bake(mdi3);
for (auto &dispatchInfo : mdi3) {
EXPECT_EQ(expectedResult[0], dispatchInfo.getLocalWorkgroupSize().x);
EXPECT_EQ(expectedResult[1], dispatchInfo.getLocalWorkgroupSize().y);
EXPECT_EQ(expectedResult[2], dispatchInfo.getLocalWorkgroupSize().z);
EXPECT_EQ(4u, dispatchInfo.getLocalWorkgroupSize().y);
EXPECT_EQ(4u, dispatchInfo.getLocalWorkgroupSize().z);
EXPECT_EQ(4u, dispatchInfo.getLocalWorkgroupSize().x);
}
delete diBuilder;
}
TEST_F(DispatchInfoBuilderTest, GivenNoSplitWhenCheckingIfBuiltinThenReturnTrue) {

View File

@@ -49,6 +49,8 @@
using namespace NEO;
using namespace DeviceHostQueue;
using KernelTest = ::testing::Test;
class KernelTests : public ProgramFromBinaryFixture {
public:
~KernelTests() override = default;
@@ -2592,7 +2594,8 @@ TEST(KernelTest, WhenSettingKernelArgThenBuiltinDispatchInfoBuilderIsUsed) {
EXPECT_EQ(31U, std::get<1>(mockBuilder.receivedArgs[3]));
EXPECT_EQ(reinterpret_cast<const void *>(37), std::get<2>(mockBuilder.receivedArgs[3]));
}
TEST(KernelTest, givenKernelWhenDebugFlagToUseMaxSimdForCalculationsIsUsedThenMaxWorkgroupSizeIsSimdSizeDependant) {
HWTEST_F(KernelTest, givenKernelWhenDebugFlagToUseMaxSimdForCalculationsIsUsedThenMaxWorkgroupSizeIsSimdSizeDependant) {
DebugManagerStateRestore dbgStateRestore;
DebugManager.flags.UseMaxSimdSizeToDeduceMaxWorkgroupSize.set(true);

View File

@@ -1,11 +1,11 @@
/*
* Copyright (C) 2017-2020 Intel Corporation
* Copyright (C) 2017-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
__kernel __attribute__((reqd_work_group_size(8, 4, 4)))
__kernel __attribute__((reqd_work_group_size(8, 2, 2)))
void CopyBuffer(
__global unsigned int *src,
__global unsigned int *dst)