Add flag for forcing usage of hostPtrTracking

Change-Id: I1a7c27145fcb23a54d49edf24659225621dd4496
This commit is contained in:
kamdiedrich
2020-01-24 11:30:07 +01:00
committed by sys_ocldev
parent 715e32b6a5
commit 39198dfda2
2 changed files with 24 additions and 2 deletions

View File

@@ -140,6 +140,10 @@ class MemoryManager {
MOCKABLE_VIRTUAL bool isHostPointerTrackingEnabled();
void setForceNonSvmForExternalHostPtr(bool mode) {
forceNonSvmForExternalHostPtr = mode;
}
const ExecutionEnvironment &peekExecutionEnvironment() const { return executionEnvironment; }
OsContext *createAndRegisterOsContext(CommandStreamReceiver *commandStreamReceiver, aub_stream::EngineType engineType,
@@ -197,8 +201,16 @@ class MemoryManager {
static bool isCopyRequired(ImageInfo &imgInfo, const void *hostPtr);
bool useNonSvmHostPtrAlloc(GraphicsAllocation::AllocationType allocationType) {
return ((allocationType == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR || allocationType == GraphicsAllocation::AllocationType::MAP_ALLOCATION) &&
(!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled()) & !is32bit);
bool isExternalHostPtrAlloc = (allocationType == GraphicsAllocation::AllocationType::EXTERNAL_HOST_PTR);
bool isMapAlloc = (allocationType == GraphicsAllocation::AllocationType::MAP_ALLOCATION);
if (forceNonSvmForExternalHostPtr && isExternalHostPtrAlloc) {
return true;
}
bool isNonSvmPtrCapable = ((!peekExecutionEnvironment().isFullRangeSvm() || !isHostPointerTrackingEnabled()) & !is32bit);
return isNonSvmPtrCapable && (isExternalHostPtrAlloc || isMapAlloc);
}
StorageInfo createStorageInfoFromProperties(const AllocationProperties &properties);
@@ -219,6 +231,7 @@ class MemoryManager {
virtual void freeAssociatedResourceImpl(GraphicsAllocation &graphicsAllocation) { return unlockResourceImpl(graphicsAllocation); };
uint32_t getBanksCount();
bool forceNonSvmForExternalHostPtr = false;
bool force32bitAllocations = false;
bool virtualPaddingAvailable = false;
std::unique_ptr<DeferredDeleter> deferredDeleter;