Revert "fix: remove not needed check in OCL CPU copy path 2"

This reverts commit 0a27aa9f7b.

Signed-off-by: Compute-Runtime-Validation <compute-runtime-validation@intel.com>
This commit is contained in:
Compute-Runtime-Validation
2024-05-17 10:18:42 +02:00
committed by Compute-Runtime-Automation
parent 015daac775
commit 4c5d567b40
3 changed files with 7 additions and 3 deletions

View File

@@ -774,6 +774,10 @@ bool Buffer::isReadWriteOnCpuAllowed(const Device &device) {
return false;
}
if (graphicsAllocation->isAllocatedInLocalMemoryPool()) {
return false;
}
return true;
}

View File

@@ -338,6 +338,6 @@ TEST(ReadWriteBufferOnCpu, whenLocalMemoryPoolAllocationIsAskedForPreferenceThen
ASSERT_NE(nullptr, buffer.get());
reinterpret_cast<MemoryAllocation *>(buffer->getGraphicsAllocation(device->getRootDeviceIndex()))->overrideMemoryPool(MemoryPool::localMemory);
EXPECT_TRUE(buffer->isReadWriteOnCpuAllowed(device->getDevice()));
EXPECT_FALSE(buffer->isReadWriteOnCpuAllowed(device->getDevice()));
EXPECT_FALSE(buffer->isReadWriteOnCpuPreferred(reinterpret_cast<void *>(0x1000), MemoryConstants::pageSize, device->getDevice()));
}

View File

@@ -72,14 +72,14 @@ TEST(Buffer, givenBufferWhenAskedForPtrLengthThenReturnCorrectValue) {
EXPECT_EQ(size[0], retOffset);
}
TEST(Buffer, whenBufferAllocatedInLocalMemoryThenCpuCopyIsAllowed) {
TEST(Buffer, whenBufferAllocatedInLocalMemoryThenCpuCopyIsDisallowed) {
MockGraphicsAllocation allocation{};
MockBuffer buffer(allocation);
UltDeviceFactory factory{1, 0};
auto &device = *factory.rootDevices[0];
allocation.memoryPool = MemoryPool::localMemory;
EXPECT_TRUE(buffer.isReadWriteOnCpuAllowed(device));
EXPECT_FALSE(buffer.isReadWriteOnCpuAllowed(device));
allocation.memoryPool = MemoryPool::system4KBPages;
EXPECT_TRUE(buffer.isReadWriteOnCpuAllowed(device));