From 2b956651a71d5d4bd44ef90843495f2c49ff5f3f Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Mon, 19 Apr 2021 10:17:13 +0000 Subject: [PATCH] Mark Shared resource copy allocations as lockable Related-To: NEO-5733 Signed-off-by: Mateusz Jablonski --- .../unit_test/memory_manager/graphics_allocation_tests.cpp | 4 ++++ shared/source/memory_manager/graphics_allocation.h | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/opencl/test/unit_test/memory_manager/graphics_allocation_tests.cpp b/opencl/test/unit_test/memory_manager/graphics_allocation_tests.cpp index ba71838375..9a69c3d132 100644 --- a/opencl/test/unit_test/memory_manager/graphics_allocation_tests.cpp +++ b/opencl/test/unit_test/memory_manager/graphics_allocation_tests.cpp @@ -180,6 +180,10 @@ TEST(GraphicsAllocationTest, whenAllocationTypeIsSvmGpuThenAllocationIsLockable) EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::SVM_GPU)); } +TEST(GraphicsAllocationTest, whenAllocationTypeIsSharedResourceCopyThenAllocationIsLockable) { + EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::SHARED_RESOURCE_COPY)); +} + TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferCompressedThenAllocationIsNotLockable) { EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER_COMPRESSED)); } diff --git a/shared/source/memory_manager/graphics_allocation.h b/shared/source/memory_manager/graphics_allocation.h index 0c383e0ce1..07559003b9 100644 --- a/shared/source/memory_manager/graphics_allocation.h +++ b/shared/source/memory_manager/graphics_allocation.h @@ -236,7 +236,8 @@ class GraphicsAllocation : public IDNode { allocationType == AllocationType::BUFFER || allocationType == AllocationType::BUFFER_HOST_MEMORY || allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER || - allocationType == AllocationType::SVM_GPU; + allocationType == AllocationType::SVM_GPU || + allocationType == AllocationType::SHARED_RESOURCE_COPY; } static bool isIsaAllocationType(GraphicsAllocation::AllocationType type) {