Add ULT for buffer allocation in case of LimitedRange and 32 bit on Windows

Related-To: NEO-2877

Change-Id: I0a918afc7c8cc5b84a3055b99c38d5c7a4d80034
Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
This commit is contained in:
Venevtsev, Igor
2019-07-22 13:54:31 +02:00
committed by sys_ocldev
parent 4e98d34471
commit a0e7b703ca

View File

@ -1735,3 +1735,24 @@ TEST_F(WddmMemoryManagerSimpleTest, givenWriteCombinedAllocationThenCpuAddressIs
TEST_F(WddmMemoryManagerSimpleTest, whenCreatingWddmMemoryManagerThenSupportsMultiStorageResourcesFlagIsSetToFalse) {
EXPECT_TRUE(memoryManager->supportsMultiStorageResources);
}
TEST_F(WddmMemoryManagerSimpleTest, givenBufferHostMemoryAllocationAndLimitedRangeAnd32BitThenAllocationGoesToSvmHeap) {
if (executionEnvironment->isFullRangeSvm()) {
GTEST_SKIP();
}
memoryManager.reset(new MockWddmMemoryManager(true, true, *executionEnvironment));
size_t size = 2 * MemoryConstants::megaByte;
auto allocation = static_cast<WddmAllocation *>(memoryManager->allocateGraphicsMemoryWithProperties({size, GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY}));
ASSERT_NE(nullptr, allocation);
EXPECT_EQ(size, allocation->getUnderlyingBufferSize());
EXPECT_NE(nullptr, allocation->getUnderlyingBuffer());
EXPECT_NE(nullptr, reinterpret_cast<void *>(allocation->getGpuAddress()));
auto heap = is32bit ? HeapIndex::HEAP_SVM : HeapIndex::HEAP_STANDARD;
EXPECT_LT(GmmHelper::canonize(memoryManager->gfxPartition.getHeapBase(heap)), allocation->getGpuAddress());
EXPECT_GT(GmmHelper::canonize(memoryManager->gfxPartition.getHeapLimit(heap)), allocation->getGpuAddress());
memoryManager->freeGraphicsMemory(allocation);
}