mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 10:26:29 +08:00
Refactor KernelInfo
Using kernelDescriptor's workgroupWalkOrder, workgroupDimensionsOrder and requiresWorkgroupWalkOrder flag. Related-To: NEO-3739
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
bfbc0e07ba
commit
2ef52ff39c
@@ -546,13 +546,13 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, whenSendingIndirectStateThenKe
|
||||
|
||||
KernelInfo modifiedKernelInfo = {};
|
||||
modifiedKernelInfo.patchInfo = kernel->getKernelInfo().patchInfo;
|
||||
modifiedKernelInfo.workgroupWalkOrder[0] = 2;
|
||||
modifiedKernelInfo.workgroupWalkOrder[1] = 1;
|
||||
modifiedKernelInfo.workgroupWalkOrder[2] = 0;
|
||||
modifiedKernelInfo.workgroupDimensionsOrder[0] = 2;
|
||||
modifiedKernelInfo.workgroupDimensionsOrder[1] = 1;
|
||||
modifiedKernelInfo.workgroupDimensionsOrder[2] = 0;
|
||||
MockKernel mockKernel{kernel->getProgram(), modifiedKernelInfo, false};
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupWalkOrder[0] = 2;
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupWalkOrder[1] = 1;
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupWalkOrder[2] = 0;
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupDimensionsOrder[0] = 2;
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupDimensionsOrder[1] = 1;
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupDimensionsOrder[2] = 0;
|
||||
MockKernel mockKernel(kernel->getProgram(), modifiedKernelInfo, false);
|
||||
uint32_t interfaceDescriptorIndex = 0;
|
||||
auto isCcsUsed = EngineHelpers::isCcs(cmdQ.getGpgpuEngine().osContext->getEngineType());
|
||||
auto kernelUsesLocalIds = HardwareCommandsHelper<FamilyType>::kernelUsesLocalIds(mockKernel);
|
||||
@@ -582,7 +582,10 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HardwareCommandsTest, whenSendingIndirectStateThenKe
|
||||
uint32_t grfSize = sizeof(typename FamilyType::GRF);
|
||||
generateLocalIDs(expectedLocalIds, modifiedKernelInfo.getMaxSimdSize(),
|
||||
std::array<uint16_t, 3>{{localWorkSizeX, localWorkSizeY, localWorkSizeZ}},
|
||||
std::array<uint8_t, 3>{{modifiedKernelInfo.workgroupDimensionsOrder[0], modifiedKernelInfo.workgroupDimensionsOrder[1], modifiedKernelInfo.workgroupDimensionsOrder[2]}}, false, grfSize);
|
||||
std::array<uint8_t, 3>{{modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupDimensionsOrder[0],
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupDimensionsOrder[1],
|
||||
modifiedKernelInfo.kernelDescriptor.kernelAttributes.workgroupDimensionsOrder[2]}},
|
||||
false, grfSize);
|
||||
EXPECT_EQ(0, memcmp(expectedLocalIds, ioh.getCpuBase(), expectedIohSize));
|
||||
alignedFree(expectedLocalIds);
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@ HWTEST_F(PerThreadDataXYZTests, Given256x1x1WhenSendingPerThreadDataThenCorrectA
|
||||
MockGraphicsAllocation gfxAllocation(indirectHeapMemory, indirectHeapMemorySize);
|
||||
LinearStream indirectHeap(&gfxAllocation);
|
||||
|
||||
size_t localWorkSizes[3] = {256, 1, 1};
|
||||
auto localWorkSize = localWorkSizes[0] * localWorkSizes[1] * localWorkSizes[2];
|
||||
const std::array<uint16_t, 3> localWorkSizes = {{256, 1, 1}};
|
||||
size_t localWorkSize = localWorkSizes[0] * localWorkSizes[1] * localWorkSizes[2];
|
||||
|
||||
auto offsetPerThreadData = PerThreadDataHelper::sendPerThreadData(
|
||||
indirectHeap,
|
||||
@@ -109,7 +109,7 @@ HWTEST_F(PerThreadDataXYZTests, Given2x4x8WhenSendingPerThreadDataThenCorrectAmo
|
||||
MockGraphicsAllocation gfxAllocation(indirectHeapMemory, indirectHeapMemorySize);
|
||||
LinearStream indirectHeap(&gfxAllocation);
|
||||
|
||||
const size_t localWorkSizes[3]{2, 4, 8};
|
||||
const std::array<uint16_t, 3> localWorkSizes = {{2, 4, 8}};
|
||||
auto offsetPerThreadData = PerThreadDataHelper::sendPerThreadData(
|
||||
indirectHeap,
|
||||
simd,
|
||||
@@ -163,7 +163,7 @@ HWTEST_F(PerThreadDataNoIdsTests, GivenThreadPaylodDataWithoutLocalIdsWhenSendin
|
||||
MockGraphicsAllocation gfxAllocation(indirectHeapMemory, indirectHeapMemorySize);
|
||||
LinearStream indirectHeap(&gfxAllocation);
|
||||
|
||||
size_t localWorkSizes[3] = {256, 1, 1};
|
||||
const std::array<uint16_t, 3> localWorkSizes = {{256, 1, 1}};
|
||||
auto offsetPerThreadData = PerThreadDataHelper::sendPerThreadData(
|
||||
indirectHeap,
|
||||
simd,
|
||||
@@ -226,7 +226,8 @@ TEST(PerThreadDataTest, WhenSettingLocalIdsInPerThreadDataThenIdsAreSetInCorrect
|
||||
uint32_t numChannels = 3;
|
||||
uint32_t localWorkSize = 24;
|
||||
|
||||
size_t localWorkSizes[3] = {24, 1, 1};
|
||||
const std::array<uint16_t, 3> localWorkSizes = {{24, 1, 1}};
|
||||
const std::array<uint8_t, 3> workgroupWalkOrder = {{0, 1, 2}};
|
||||
|
||||
auto sizePerThreadDataTotal = PerThreadDataHelper::getPerThreadDataSizeTotal(simd, numChannels, localWorkSize, grfSize);
|
||||
|
||||
@@ -245,7 +246,7 @@ TEST(PerThreadDataTest, WhenSettingLocalIdsInPerThreadDataThenIdsAreSetInCorrect
|
||||
grfSize,
|
||||
numChannels,
|
||||
localWorkSizes,
|
||||
{{0, 1, 2}},
|
||||
workgroupWalkOrder,
|
||||
false);
|
||||
|
||||
// Check if buffer overrun happend, only first sizePerThreadDataTotal bytes can be overwriten, following should be same as reference.
|
||||
@@ -264,7 +265,8 @@ TEST(PerThreadDataTest, givenSimdEqualOneWhenSettingLocalIdsInPerThreadDataThenI
|
||||
uint32_t numChannels = 3;
|
||||
uint32_t localWorkSize = 24;
|
||||
|
||||
size_t localWorkSizes[3] = {3, 4, 2};
|
||||
const std::array<uint16_t, 3> localWorkSizes = {{3, 4, 2}};
|
||||
const std::array<uint8_t, 3> workgroupWalkOrder = {{0, 1, 2}};
|
||||
|
||||
auto sizePerThreadDataTotal = PerThreadDataHelper::getPerThreadDataSizeTotal(simd, grfSize, numChannels, localWorkSize);
|
||||
|
||||
@@ -283,7 +285,7 @@ TEST(PerThreadDataTest, givenSimdEqualOneWhenSettingLocalIdsInPerThreadDataThenI
|
||||
grfSize,
|
||||
numChannels,
|
||||
localWorkSizes,
|
||||
{{0, 1, 2}},
|
||||
workgroupWalkOrder,
|
||||
false);
|
||||
|
||||
auto bufferPtr = buffer;
|
||||
|
||||
Reference in New Issue
Block a user