Revert "Disable host ptr tracking for GEN12LP+"

Related-To: NEO-3661

This reverts commit 8f6a390a2f.

Change-Id: Ib17543e2c2c7e47c92bbc010d376dd53c6116b59
Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
Pawel Wilma
2019-11-28 08:51:13 +01:00
committed by sys_ocldev
parent 1dcc059826
commit a08fb12c4c
17 changed files with 17 additions and 57 deletions

View File

@@ -66,8 +66,7 @@ const RuntimeCapabilityTable EHL::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable EHL::workaroundTable = {};

View File

@@ -67,8 +67,7 @@ const RuntimeCapabilityTable ICLLP::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable ICLLP::workaroundTable = {};

View File

@@ -66,8 +66,7 @@ const RuntimeCapabilityTable LKF::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable LKF::workaroundTable = {};

View File

@@ -67,8 +67,7 @@ const RuntimeCapabilityTable TGLLP::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
false // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable TGLLP::workaroundTable = {};

View File

@@ -71,8 +71,7 @@ const RuntimeCapabilityTable BDW::capabilityTable{
false, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable BDW::workaroundTable = {};

View File

@@ -68,8 +68,7 @@ const RuntimeCapabilityTable BXT::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
false, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
false // supportsDeviceEnqueue
};
WorkaroundTable BXT::workaroundTable = {};

View File

@@ -63,8 +63,7 @@ const RuntimeCapabilityTable CFL::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable CFL::workaroundTable = {};

View File

@@ -63,8 +63,7 @@ const RuntimeCapabilityTable GLK::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
false, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
false // supportsDeviceEnqueue
};
WorkaroundTable GLK::workaroundTable = {};

View File

@@ -63,8 +63,7 @@ const RuntimeCapabilityTable KBL::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable KBL::workaroundTable = {};

View File

@@ -71,8 +71,7 @@ const RuntimeCapabilityTable SKL::capabilityTable{
true, // supportsVme
false, // supportCacheFlushAfterWalker
true, // supportsImages
true, // supportsDeviceEnqueue
true // hostPtrTrackingEnabled
true // supportsDeviceEnqueue
};
WorkaroundTable SKL::workaroundTable = {};
FeatureTable SKL::featureTable = {};

View File

@@ -51,7 +51,6 @@ struct RuntimeCapabilityTable {
bool supportCacheFlushAfterWalker;
bool supportsImages;
bool supportsDeviceEnqueue;
bool hostPtrTrackingEnabled;
};
struct HardwareCapabilities {

View File

@@ -341,7 +341,7 @@ GraphicsAllocation *MemoryManager::allocateGraphicsMemory(const AllocationData &
return allocateGraphicsMemoryForImage(allocationData);
}
if (allocationData.type == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR &&
(!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled())) {
(!peekExecutionEnvironment().isFullRangeSvm() || !DebugManager.flags.EnableHostPtrTracking.get())) {
auto allocation = allocateGraphicsMemoryForNonSvmHostPtr(allocationData);
if (allocation) {
allocation->setFlushL3Required(allocationData.flags.flushL3);
@@ -486,11 +486,4 @@ void *MemoryManager::getReservedMemory(size_t size, size_t alignment) {
return reservedMemory;
}
bool MemoryManager::isHostPointerTrackingEnabled() {
if (DebugManager.flags.EnableHostPtrTracking.get() != -1) {
return !!DebugManager.flags.EnableHostPtrTracking.get();
}
return (peekExecutionEnvironment().getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled | is32bit);
}
} // namespace NEO

View File

@@ -144,8 +144,6 @@ class MemoryManager {
::alignedFree(ptr);
}
MOCKABLE_VIRTUAL bool isHostPointerTrackingEnabled();
const ExecutionEnvironment &peekExecutionEnvironment() const { return executionEnvironment; }
OsContext *createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, aub_stream::EngineType engineType,

View File

@@ -87,7 +87,7 @@ DECLARE_DEBUG_VARIABLE(bool, DisableConcurrentBlockExecution, false, "disables c
DECLARE_DEBUG_VARIABLE(bool, UseNoRingFlushesKmdMode, true, "Windows only, passes flag to KMD that informs KMD to not emit any ring buffer flushes.")
DECLARE_DEBUG_VARIABLE(bool, DisableZeroCopyForUseHostPtr, false, "When active all buffer allocations created with CL_MEM_USE_HOST_PTR flag will not share memory with CPU.")
DECLARE_DEBUG_VARIABLE(bool, DisableZeroCopyForBuffers, false, "When active all buffer allocations will not share memory with CPU.")
DECLARE_DEBUG_VARIABLE(int32_t, EnableHostPtrTracking, -1, "Enable host ptr tracking: -1 - default platform setting, 0 - disabled, 1 - enabled")
DECLARE_DEBUG_VARIABLE(bool, EnableHostPtrTracking, true, "Enable host ptr tracking")
DECLARE_DEBUG_VARIABLE(bool, DisableDcFlushInEpilogue, false, "Disable DC flush in epilogue")
/*FEATURE FLAGS*/

View File

@@ -419,7 +419,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio
size_t size = sizeof(memory);
HostPtrSurface surface(const_cast<char *>(memory), size, true);
if (device->isFullRangeSvm() && gmockMemoryManager->isHostPointerTrackingEnabled()) {
if (device->isFullRangeSvm()) {
EXPECT_CALL(*gmockMemoryManager, populateOsHandles(::testing::_))
.Times(1)
.WillOnce(::testing::Return(MemoryManager::AllocationStatus::InvalidHostPointer));
@@ -446,7 +446,7 @@ TEST_F(CreateAllocationForHostSurfaceTest, givenReadOnlyHostPointerWhenAllocatio
size_t size = sizeof(memory);
HostPtrSurface surface(const_cast<char *>(memory), size, false);
if (device->isFullRangeSvm() && gmockMemoryManager->isHostPointerTrackingEnabled()) {
if (device->isFullRangeSvm()) {
EXPECT_CALL(*gmockMemoryManager, populateOsHandles(::testing::_))
.Times(1)
.WillOnce(::testing::Return(MemoryManager::AllocationStatus::InvalidHostPointer));

View File

@@ -1183,7 +1183,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenFullGpuAddressSpaceWhenAllocateGr
bool requiresL3Flush = GetParam();
MockExecutionEnvironment executionEnvironment(*platformDevices);
executionEnvironment.setHwInfo(platformDevices[0]);
if (!executionEnvironment.isFullRangeSvm() || !executionEnvironment.getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled) {
if (!executionEnvironment.isFullRangeSvm()) {
return;
}
OsAgnosticMemoryManager memoryManager(executionEnvironment);
@@ -1201,7 +1201,7 @@ TEST_P(OsAgnosticMemoryManagerWithParams, givenFullGpuAddressSpaceWhenAllocateGr
TEST_P(OsAgnosticMemoryManagerWithParams, givenDisabledHostPtrTrackingWhenAllocateGraphicsMemoryForHostPtrIsCalledThenAllocationWithoutFragmentsIsCreated) {
DebugManagerStateRestore restore;
DebugManager.flags.EnableHostPtrTracking.set(0);
DebugManager.flags.EnableHostPtrTracking.set(false);
bool requiresL3Flush = GetParam();
MockExecutionEnvironment executionEnvironment(*platformDevices);
@@ -1945,23 +1945,3 @@ TEST(MemoryManagerTest, whenMemoryManagerReturnsNullptrThenAllocateGlobalsSurfac
allocation = allocateGlobalsSurface(&context, &device, 1024, false, true, nullptr);
EXPECT_EQ(nullptr, allocation);
}
HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenEnableHostPtrTrackingFlagIsSetTo0ThenHostPointerTrackingIsDisabled) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.EnableHostPtrTracking.set(0);
EXPECT_FALSE(memoryManager->isHostPointerTrackingEnabled());
}
HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenEnableHostPtrTrackingFlagIsNotSetTo1ThenHostPointerTrackingIsEnabled) {
DebugManagerStateRestore dbgRestore;
DebugManager.flags.EnableHostPtrTracking.set(1);
EXPECT_TRUE(memoryManager->isHostPointerTrackingEnabled());
}
HWTEST_F(MemoryAllocatorTest, givenMemoryManagerWhenEnableHostPtrTrackingFlagIsSetNotSetThenHostPointerTrackingDependsOnCapabilityTable) {
if (is32bit) {
EXPECT_TRUE(memoryManager->isHostPointerTrackingEnabled());
} else {
EXPECT_EQ(executionEnvironment->getHardwareInfo()->capabilityTable.hostPtrTrackingEnabled, memoryManager->isHostPointerTrackingEnabled());
}
}

View File

@@ -108,7 +108,7 @@ RenderCompressedBuffersEnabled = -1
AUBDumpAllocsOnEnqueueReadOnly = 0
AUBDumpForceAllToLocalMemory = 0
EnableCacheFlushAfterWalker = -1
EnableHostPtrTracking = -1
EnableHostPtrTracking = 1
DisableDcFlushInEpilogue = 0
OverrideInvalidEngineWithDefault = 0
EnableFormatQuery = 0