From de116aac5cdbe34ef27f7431e8ff9099b2ea6528 Mon Sep 17 00:00:00 2001 From: Mateusz Jablonski Date: Wed, 28 Apr 2021 19:08:29 +0000 Subject: [PATCH] Make buffer allocations not lockable Related-To: NEO-5733 Signed-off-by: Mateusz Jablonski --- .../unit_test/memory_manager/graphics_allocation_tests.cpp | 7 +++++-- shared/source/memory_manager/graphics_allocation.h | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) 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 9a69c3d132..ecbe361f16 100644 --- a/opencl/test/unit_test/memory_manager/graphics_allocation_tests.cpp +++ b/opencl/test/unit_test/memory_manager/graphics_allocation_tests.cpp @@ -167,8 +167,11 @@ TEST(GraphicsAllocationTest, whenAllocationTypeIsISAThenAllocationIsLockable) { EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL)); } -TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferThenAllocationIsLockable) { - EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER)); +TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferThenAllocationIsNotLockable) { + EXPECT_FALSE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER)); +} + +TEST(GraphicsAllocationTest, whenAllocationTypeIsBufferHostMemoryThenAllocationIsLockable) { EXPECT_TRUE(GraphicsAllocation::isLockable(GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY)); } diff --git a/shared/source/memory_manager/graphics_allocation.h b/shared/source/memory_manager/graphics_allocation.h index 07559003b9..807bb07731 100644 --- a/shared/source/memory_manager/graphics_allocation.h +++ b/shared/source/memory_manager/graphics_allocation.h @@ -233,7 +233,6 @@ class GraphicsAllocation : public IDNode { static bool isLockable(AllocationType allocationType) { return isCpuAccessRequired(allocationType) || isIsaAllocationType(allocationType) || - allocationType == AllocationType::BUFFER || allocationType == AllocationType::BUFFER_HOST_MEMORY || allocationType == AllocationType::GPU_TIMESTAMP_DEVICE_BUFFER || allocationType == AllocationType::SVM_GPU ||