From a18fb402a0f166d8a5f189fcb013e1d37ac917a1 Mon Sep 17 00:00:00 2001 From: "Milczarek, Slawomir" Date: Thu, 22 Jul 2021 16:33:26 +0000 Subject: [PATCH] Add resolves for SVM GPU allocations if aux translation is required Related-To: NEO-5107 Signed-off-by: Milczarek, Slawomir --- opencl/source/kernel/kernel.cpp | 3 ++- opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/opencl/source/kernel/kernel.cpp b/opencl/source/kernel/kernel.cpp index 2b3939cefc..d9084cb4a4 100644 --- a/opencl/source/kernel/kernel.cpp +++ b/opencl/source/kernel/kernel.cpp @@ -2470,7 +2470,8 @@ void Kernel::fillWithKernelObjsForAuxTranslation(KernelObjsForAuxTranslation &ke } if (DebugManager.flags.EnableStatelessCompression.get()) { for (auto gfxAllocation : kernelUnifiedMemoryGfxAllocations) { - if (gfxAllocation->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) { + if ((gfxAllocation->getAllocationType() == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) || + (gfxAllocation->getAllocationType() == GraphicsAllocation::AllocationType::SVM_GPU)) { kernelObjsForAuxTranslation.insert({KernelObjForAuxTranslation::Type::GFX_ALLOC, gfxAllocation}); auto &context = this->program->getContext(); if (context.isProvidingPerformanceHints()) { diff --git a/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp b/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp index 7eaffddfae..0ee780024f 100644 --- a/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp +++ b/opencl/test/unit_test/kernel/kernel_arg_buffer_tests.cpp @@ -613,7 +613,8 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta const auto allocationTypes = {GraphicsAllocation::AllocationType::BUFFER, GraphicsAllocation::AllocationType::BUFFER_COMPRESSED, - GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY}; + GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + GraphicsAllocation::AllocationType::SVM_GPU}; MockGraphicsAllocation gfxAllocation; @@ -625,7 +626,8 @@ TEST_F(KernelArgBufferTest, givenSetUnifiedMemoryExecInfoOnKernelWithIndirectSta KernelObjsForAuxTranslation kernelObjsForAuxTranslation; pKernel->fillWithKernelObjsForAuxTranslation(kernelObjsForAuxTranslation); - if (type == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) { + if ((type == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED) || + (type == GraphicsAllocation::AllocationType::SVM_GPU)) { EXPECT_EQ(1u, kernelObjsForAuxTranslation.size()); auto kernelObj = *kernelObjsForAuxTranslation.find({KernelObjForAuxTranslation::Type::GFX_ALLOC, &gfxAllocation}); EXPECT_NE(nullptr, kernelObj.object);