Add debug variable to disable host ptr tracking.

Change-Id: Ifc866e06a4519e7590d40d8ad136147ecc80225d
This commit is contained in:
Piotr Fusik
2019-01-10 11:10:58 +01:00
committed by sys_ocldev
parent 936af1b5a8
commit 30dd15144c
10 changed files with 54 additions and 16 deletions

View File

@@ -1076,6 +1076,23 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenFullGpuAddressSpaceWhenAllocateGr
memoryManager.freeGraphicsMemory(allocation);
}
TEST_P(OsAgnosticMemoryManagerWithParams, givenDisabledHostPtrTrackingWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithoutFragmentsIsCreated) {
DebugManagerStateRestore restore;
DebugManager.flags.EnableHostPtrTracking.set(false);
bool requiresL3Flush = GetParam();
ExecutionEnvironment executionEnvironment;
OsAgnosticMemoryManager memoryManager(false, false, executionEnvironment);
auto hostPtr = reinterpret_cast<void *>(0x5001);
auto allocation = memoryManager.allocateGraphicsMemoryForHostPtr(13, hostPtr, true, requiresL3Flush);
EXPECT_NE(nullptr, allocation);
EXPECT_EQ(0u, allocation->fragmentsStorage.fragmentCount);
EXPECT_EQ(requiresL3Flush, allocation->flushL3Required);
memoryManager.freeGraphicsMemory(allocation);
}
INSTANTIATE_TEST_CASE_P(OsAgnosticMemoryManagerWithParams,
OsAgnosticMemoryManagerWithParams,
::testing::Values(false, true));