Add resolves for unified memory when aux translation is required

Related-To: NEO-5107

Signed-off-by: Milczarek, Slawomir <slawomir.milczarek@intel.com>
This commit is contained in:
Milczarek, Slawomir
2021-07-21 15:03:58 +00:00
committed by Compute-Runtime-Automation
parent 64f86817f8
commit 330856c9e9
5 changed files with 101 additions and 0 deletions

View File

@ -605,6 +605,41 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta
}
}
TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectStatelessAccessWhenFillWithKernelObjsForAuxTranslationIsCalledThenSetKernelObjectsForAuxTranslation) {
DebugManagerStateRestore debugRestorer;
DebugManager.flags.EnableStatelessCompression.set(1);
pKernelInfo->hasIndirectStatelessAccess = true;
const auto allocationTypes = {GraphicsAllocation::AllocationType::BUFFER,
GraphicsAllocation::AllocationType::BUFFER_COMPRESSED,
GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY};
MockGraphicsAllocation gfxAllocation;
for (const auto type : allocationTypes) {
gfxAllocation.setAllocationType(type);
pKernel->setUnifiedMemoryExecInfo(&gfxAllocation);
KernelObjsForAuxTranslation kernelObjsForAuxTranslation;
pKernel->fillWithKernelObjsForAuxTranslation(kernelObjsForAuxTranslation);
if (type == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) {
EXPECT_EQ(1u, kernelObjsForAuxTranslation.size());
auto kernelObj = *kernelObjsForAuxTranslation.find({KernelObjForAuxTranslation::Type::GFX_ALLOC, &gfxAllocation});
EXPECT_NE(nullptr, kernelObj.object);
EXPECT_EQ(KernelObjForAuxTranslation::Type::GFX_ALLOC, kernelObj.type);
kernelObjsForAuxTranslation.erase(kernelObj);
} else {
EXPECT_EQ(0u, kernelObjsForAuxTranslation.size());
}
pKernel->clearUnifiedMemoryExecInfo();
pKernel->setAuxTranslationRequired(false);
}
}
class KernelArgBufferFixtureBindless : public KernelArgBufferFixture {
public:
void SetUp() {