Add new allocation type for device queue's allocatons

remove not used mustBeZeroCopy flag

Related-To: NEO-2733

Change-Id: I8b8faf4e2d46249f897a06170dd777193c7f8729
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2019-04-15 13:10:26 +02:00
committed by sys_ocldev
parent e40a82336c
commit 1e11d8939f
7 changed files with 43 additions and 52 deletions

View File

@ -26,19 +26,17 @@ TEST(MemoryManagerGetAlloctionDataTest, givenHostMemoryAllocationTypeAndAllocate
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_TRUE(allocData.flags.mustBeZeroCopy);
EXPECT_TRUE(allocData.flags.useSystemMemory);
EXPECT_EQ(10u, allocData.size);
EXPECT_EQ(nullptr, allocData.hostPtr);
}
TEST(MemoryManagerGetAlloctionDataTest, givenNonHostMemoryAllocatoinTypeWhenAllocationDataIsQueriedThenMustBeZeroCopyAndUseSystemMemoryFlagsAreNotSet) {
TEST(MemoryManagerGetAlloctionDataTest, givenNonHostMemoryAllocatoinTypeWhenAllocationDataIsQueriedThenUseSystemMemoryFlagsIsNotSet) {
AllocationData allocData;
AllocationProperties properties(true, 10, GraphicsAllocation::AllocationType::BUFFER);
MockMemoryManager::getAllocationData(allocData, properties, {}, nullptr);
EXPECT_FALSE(allocData.flags.mustBeZeroCopy);
EXPECT_FALSE(allocData.flags.useSystemMemory);
EXPECT_EQ(10u, allocData.size);
EXPECT_EQ(nullptr, allocData.hostPtr);
@ -345,10 +343,9 @@ TEST(MemoryManagerTest, givenMemoryManagerWhenBufferTypeIsPassedAndAllocateInDev
memoryManager.freeGraphicsMemory(allocation);
}
TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenZeroCopyIsRequested) {
TEST(MemoryManagerTest, givenSvmAllocationTypeWhenGetAllocationDataIsCalledThenAllocatingMemoryIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::SVM_ZERO_COPY}, {}, nullptr);
EXPECT_TRUE(allocData.flags.mustBeZeroCopy);
EXPECT_TRUE(allocData.flags.allocateMemory);
}
@ -371,6 +368,12 @@ TEST(MemoryManagerTest, givenTagBufferTypeWhenGetAllocationDataIsCalledThenSyste
EXPECT_TRUE(allocData.flags.useSystemMemory);
}
TEST(MemoryManagerTest, givenDeviceQueueBufferTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::DEVICE_QUEUE_BUFFER}, {}, nullptr);
EXPECT_TRUE(allocData.flags.useSystemMemory);
}
TEST(MemoryManagerTest, givenFillPatternTypeWhenGetAllocationDataIsCalledThenSystemMemoryIsRequested) {
AllocationData allocData;
MockMemoryManager::getAllocationData(allocData, {1, GraphicsAllocation::AllocationType::FILL_PATTERN}, {}, nullptr);
@ -461,7 +464,6 @@ TEST(MemoryManagerTest, givenExternalHostMemoryWhenGetAllocationDataIsCalledThen
auto hostPtr = reinterpret_cast<void *>(0x1234);
MockMemoryManager::getAllocationData(allocData, {false, 1, GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR}, {}, hostPtr);
EXPECT_TRUE(allocData.flags.useSystemMemory);
EXPECT_TRUE(allocData.flags.mustBeZeroCopy);
EXPECT_FALSE(allocData.flags.allocateMemory);
EXPECT_FALSE(allocData.flags.allow32Bit);
EXPECT_FALSE(allocData.flags.allow64kbPages);