mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
Revert "fix: setGroupSize caching to not hide error"
This reverts commit 56b167f530.
Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
50d831bee0
commit
375f212b2d
@@ -301,12 +301,15 @@ ze_result_t KernelImp::setGroupSize(uint32_t groupSizeX, uint32_t groupSizeY,
|
|||||||
return ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION;
|
return ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->groupSize[0] = groupSizeX;
|
||||||
|
this->groupSize[1] = groupSizeY;
|
||||||
|
this->groupSize[2] = groupSizeZ;
|
||||||
for (uint32_t i = 0u; i < 3u; i++) {
|
for (uint32_t i = 0u; i < 3u; i++) {
|
||||||
if (kernelDescriptor.kernelAttributes.requiredWorkgroupSize[i] != 0 &&
|
if (kernelDescriptor.kernelAttributes.requiredWorkgroupSize[i] != 0 &&
|
||||||
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[i] != groupSize[i]) {
|
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[i] != this->groupSize[i]) {
|
||||||
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr,
|
NEO::printDebugString(NEO::DebugManager.flags.PrintDebugMessages.get(), stderr,
|
||||||
"Invalid group size {%d, %d, %d} specified, requiredWorkGroupSize = {%d, %d, %d}\n",
|
"Invalid group size {%d, %d, %d} specified, requiredWorkGroupSize = {%d, %d, %d}\n",
|
||||||
groupSize[0], groupSize[1], groupSize[2],
|
this->groupSize[0], this->groupSize[1], this->groupSize[2],
|
||||||
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[0],
|
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[0],
|
||||||
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[1],
|
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[1],
|
||||||
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[2]);
|
kernelDescriptor.kernelAttributes.requiredWorkgroupSize[2]);
|
||||||
@@ -352,9 +355,6 @@ ze_result_t KernelImp::setGroupSize(uint32_t groupSizeX, uint32_t groupSizeY,
|
|||||||
|
|
||||||
this->perThreadDataSize = perThreadDataSizeForWholeThreadGroup / numThreadsPerThreadGroup;
|
this->perThreadDataSize = perThreadDataSizeForWholeThreadGroup / numThreadsPerThreadGroup;
|
||||||
}
|
}
|
||||||
this->groupSize[0] = groupSizeX;
|
|
||||||
this->groupSize[1] = groupSizeY;
|
|
||||||
this->groupSize[2] = groupSizeZ;
|
|
||||||
return ZE_RESULT_SUCCESS;
|
return ZE_RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -341,18 +341,8 @@ TEST_F(KernelImpSetGroupSizeTest, givenIncorrectGroupSizeDimensionWhenSettingGro
|
|||||||
}
|
}
|
||||||
mockKernel.module = &mockModule;
|
mockKernel.module = &mockModule;
|
||||||
|
|
||||||
uint32_t groupSize[3] = {2, 2, 2};
|
uint32_t groupSize[3] = {1, 1, 1};
|
||||||
auto ret = mockKernel.setGroupSize(groupSize[0], groupSize[1], groupSize[2]);
|
auto ret = mockKernel.setGroupSize(groupSize[0], groupSize[1], groupSize[2]);
|
||||||
EXPECT_EQ(ZE_RESULT_SUCCESS, ret);
|
|
||||||
|
|
||||||
groupSize[0] = 1;
|
|
||||||
groupSize[1] = 1;
|
|
||||||
groupSize[2] = 1;
|
|
||||||
ret = mockKernel.setGroupSize(groupSize[0], groupSize[1], groupSize[2]);
|
|
||||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION, ret);
|
|
||||||
|
|
||||||
// check that caching does not hide error
|
|
||||||
ret = mockKernel.setGroupSize(groupSize[0], groupSize[1], groupSize[2]);
|
|
||||||
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION, ret);
|
EXPECT_EQ(ZE_RESULT_ERROR_INVALID_GROUP_SIZE_DIMENSION, ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -657,28 +647,6 @@ TEST_F(KernelImmutableDataTests, givenKernelInitializedWithNoPrivateMemoryThenPr
|
|||||||
EXPECT_EQ(nullptr, kernel->privateMemoryGraphicsAllocation);
|
EXPECT_EQ(nullptr, kernel->privateMemoryGraphicsAllocation);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(KernelImmutableDataTests, givenKernelInitializedWithRequiredGroupSizeThenGroupSizeIsSetByDefault) {
|
|
||||||
uint32_t perHwThreadPrivateMemorySizeRequested = 0u;
|
|
||||||
bool isInternal = false;
|
|
||||||
|
|
||||||
std::unique_ptr<MockImmutableData> mockKernelImmData = std::make_unique<MockImmutableData>(perHwThreadPrivateMemorySizeRequested);
|
|
||||||
mockKernelImmData->mockKernelDescriptor->kernelAttributes.requiredWorkgroupSize[0] = 2u;
|
|
||||||
mockKernelImmData->mockKernelDescriptor->kernelAttributes.requiredWorkgroupSize[1] = 3u;
|
|
||||||
mockKernelImmData->mockKernelDescriptor->kernelAttributes.requiredWorkgroupSize[2] = 4u;
|
|
||||||
|
|
||||||
createModuleFromMockBinary(perHwThreadPrivateMemorySizeRequested, isInternal, mockKernelImmData.get());
|
|
||||||
|
|
||||||
std::unique_ptr<ModuleImmutableDataFixture::MockKernel> kernel;
|
|
||||||
kernel = std::make_unique<ModuleImmutableDataFixture::MockKernel>(module.get());
|
|
||||||
|
|
||||||
createKernel(kernel.get());
|
|
||||||
|
|
||||||
auto groupSize = kernel->getGroupSize();
|
|
||||||
EXPECT_EQ(groupSize[0], 2u);
|
|
||||||
EXPECT_EQ(groupSize[1], 3u);
|
|
||||||
EXPECT_EQ(groupSize[2], 4u);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(KernelImmutableDataTests, givenKernelInitializedWithPrivateMemoryThenPrivateMemoryIsCreated) {
|
TEST_F(KernelImmutableDataTests, givenKernelInitializedWithPrivateMemoryThenPrivateMemoryIsCreated) {
|
||||||
uint32_t perHwThreadPrivateMemorySizeRequested = 32u;
|
uint32_t perHwThreadPrivateMemorySizeRequested = 32u;
|
||||||
bool isInternal = false;
|
bool isInternal = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user