test: add getInlineDataSize helper function
Related-To: NEO-10641 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
parent
1317aa539b
commit
b063c3c62b
|
@ -956,7 +956,9 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, givenPassInlin
|
||||||
kd.kernelAttributes.flags.passInlineData = true;
|
kd.kernelAttributes.flags.passInlineData = true;
|
||||||
kd.kernelAttributes.numLocalIdChannels = 0;
|
kd.kernelAttributes.numLocalIdChannels = 0;
|
||||||
|
|
||||||
kernel->mockKernel->setCrossThreadData(crossThreadDataTwoGrf, sizeof(INLINE_DATA) * 2);
|
auto inlineDataSize = UnitTestHelper<FamilyType>::getInlineDataSize(cmdQ->heaplessModeEnabled);
|
||||||
|
|
||||||
|
kernel->mockKernel->setCrossThreadData(crossThreadDataTwoGrf, inlineDataSize * 2);
|
||||||
|
|
||||||
auto memoryManager = device->getUltCommandStreamReceiver<FamilyType>().getMemoryManager();
|
auto memoryManager = device->getUltCommandStreamReceiver<FamilyType>().getMemoryManager();
|
||||||
kernel->kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize});
|
kernel->kernelInfo.kernelAllocation = memoryManager->allocateGraphicsMemoryWithProperties(MockAllocationProperties{device->getRootDeviceIndex(), MemoryConstants::pageSize});
|
||||||
|
@ -971,21 +973,21 @@ HWCMDTEST_F(IGFX_XE_HP_CORE, XeHPAndLaterDispatchWalkerBasicTest, givenPassInlin
|
||||||
EXPECT_NE(hwParser.itorWalker, hwParser.cmdList.end());
|
EXPECT_NE(hwParser.itorWalker, hwParser.cmdList.end());
|
||||||
|
|
||||||
WalkerVariant walkerVariant = NEO::UnitTestHelper<FamilyType>::getWalkerVariant(*hwParser.itorWalker);
|
WalkerVariant walkerVariant = NEO::UnitTestHelper<FamilyType>::getWalkerVariant(*hwParser.itorWalker);
|
||||||
std::visit([crossThreadDataTwoGrf = crossThreadDataTwoGrf, &ih](auto &&walker) {
|
std::visit([crossThreadDataTwoGrf = crossThreadDataTwoGrf, inlineDataSize, &ih](auto &&walker) {
|
||||||
using WalkerType = std::decay_t<decltype(*walker)>;
|
using WalkerType = std::decay_t<decltype(*walker)>;
|
||||||
EXPECT_EQ(1u, walker->getEmitInlineParameter());
|
EXPECT_EQ(1u, walker->getEmitInlineParameter());
|
||||||
|
|
||||||
EXPECT_EQ(0u, walker->getGenerateLocalId());
|
EXPECT_EQ(0u, walker->getGenerateLocalId());
|
||||||
EXPECT_EQ(0u, walker->getEmitLocalId());
|
EXPECT_EQ(0u, walker->getEmitLocalId());
|
||||||
|
|
||||||
EXPECT_EQ(0, memcmp(walker->getInlineDataPointer(), crossThreadDataTwoGrf, sizeof(INLINE_DATA)));
|
EXPECT_EQ(0, memcmp(walker->getInlineDataPointer(), crossThreadDataTwoGrf, inlineDataSize));
|
||||||
void *payloadData = ih.getCpuBase();
|
void *payloadData = ih.getCpuBase();
|
||||||
EXPECT_EQ(0, memcmp(payloadData, &crossThreadDataTwoGrf[sizeof(INLINE_DATA) / sizeof(uint32_t)], sizeof(INLINE_DATA)));
|
EXPECT_EQ(0, memcmp(payloadData, &crossThreadDataTwoGrf[inlineDataSize / sizeof(uint32_t)], inlineDataSize));
|
||||||
|
|
||||||
if constexpr (std::is_same_v<WalkerType, COMPUTE_WALKER>) {
|
if constexpr (std::is_same_v<WalkerType, COMPUTE_WALKER>) {
|
||||||
size_t perThreadTotalDataSize = 0;
|
size_t perThreadTotalDataSize = 0;
|
||||||
// second GRF in indirect
|
// second GRF in indirect
|
||||||
uint32_t expectedIndirectDataLength = static_cast<uint32_t>(perThreadTotalDataSize + sizeof(INLINE_DATA));
|
uint32_t expectedIndirectDataLength = static_cast<uint32_t>(perThreadTotalDataSize + inlineDataSize);
|
||||||
expectedIndirectDataLength = alignUp(expectedIndirectDataLength, FamilyType::indirectDataAlignment);
|
expectedIndirectDataLength = alignUp(expectedIndirectDataLength, FamilyType::indirectDataAlignment);
|
||||||
EXPECT_EQ(expectedIndirectDataLength, walker->getIndirectDataLength());
|
EXPECT_EQ(expectedIndirectDataLength, walker->getIndirectDataLength());
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,7 +104,7 @@ struct UnitTestHelper {
|
||||||
static GenCmdList::iterator findCsrBaseAddressCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
static GenCmdList::iterator findCsrBaseAddressCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
||||||
|
|
||||||
static std::vector<GenCmdList::iterator> findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
static std::vector<GenCmdList::iterator> findAllMidThreadPreemptionAllocationCommand(GenCmdList::iterator begin, GenCmdList::iterator end);
|
||||||
|
static uint32_t getInlineDataSize(bool isHeaplessEnabled);
|
||||||
static bool getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
static bool getDisableFusionStateFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
||||||
static bool getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
static bool getComputeDispatchAllWalkerFromFrontEndCommand(const typename GfxFamily::FrontEndStateCommand &feCmd);
|
||||||
static bool getSystolicFlagValueFromPipelineSelectCommand(const typename GfxFamily::PIPELINE_SELECT &pipelineSelectCmd);
|
static bool getSystolicFlagValueFromPipelineSelectCommand(const typename GfxFamily::PIPELINE_SELECT &pipelineSelectCmd);
|
||||||
|
|
|
@ -79,6 +79,12 @@ bool UnitTestHelper<GfxFamily>::expectNullDsh(const DeviceInfo &deviceInfo) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename GfxFamily>
|
||||||
|
uint32_t UnitTestHelper<GfxFamily>::getInlineDataSize(bool isHeaplessEnabled) {
|
||||||
|
using DefaultWalkerType = typename GfxFamily::DefaultWalkerType;
|
||||||
|
return DefaultWalkerType::getInlineDataSize();
|
||||||
|
}
|
||||||
|
|
||||||
template <typename GfxFamily>
|
template <typename GfxFamily>
|
||||||
bool UnitTestHelper<GfxFamily>::findStateCacheFlushPipeControl(CommandStreamReceiver &csr, LinearStream &csrStream) {
|
bool UnitTestHelper<GfxFamily>::findStateCacheFlushPipeControl(CommandStreamReceiver &csr, LinearStream &csrStream) {
|
||||||
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
|
||||||
|
|
Loading…
Reference in New Issue