mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-08 22:12:59 +08:00
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:
committed by
Compute-Runtime-Automation
parent
3a2281bf77
commit
52308244a6
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user