Disallow for copying local memory buffers on CPU

Related-To: NEO-5733
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2021-04-28 15:08:10 +00:00
committed by Compute-Runtime-Automation
parent 3a2281bf77
commit 52308244a6
4 changed files with 19 additions and 26 deletions

View File

@@ -62,6 +62,19 @@ TEST(Buffer, givenBufferWhenAskedForPtrLengthThenReturnCorrectValue) {
EXPECT_EQ(size[0], retOffset);
}
TEST(Buffer, whenBufferAllocatedInLocalMemoryThenCpuCopyIsDisallowed) {
MockGraphicsAllocation allocation{};
MockBuffer buffer(allocation);
UltDeviceFactory factory{1, 0};
auto &device = *factory.rootDevices[0];
allocation.memoryPool = MemoryPool::LocalMemory;
EXPECT_FALSE(buffer.isReadWriteOnCpuAllowed(device));
allocation.memoryPool = MemoryPool::System4KBPages;
EXPECT_TRUE(buffer.isReadWriteOnCpuAllowed(device));
}
TEST(Buffer, givenReadOnlySetOfInputFlagsWhenPassedToisReadOnlyMemoryPermittedByFlagsThenTrueIsReturned) {
class MockBuffer : public Buffer {
public: