P4 to Git Change 1576208 by vsytchen@vsytchen-win10 on 2018/07/04 15:36:47

SWDEV-154903 - [Vega10][PAL] clSVMAlloc is failing to create allocations greater than 2GB

	1. Uncommit coarse grain SVM from system memory when calling clEnqueueSVMUnmap

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/15336/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpumemory.cpp#133 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#22 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#133 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#106 edit


[ROCm/clr commit: 0bc34b7062]
Tento commit je obsažen v:
foreman
2018-07-04 15:45:29 -04:00
rodič 5090f69021
revize 9523d68e19
4 změnil soubory, kde provedl 17 přidání a 0 odebrání
+4
Zobrazit soubor
@@ -411,6 +411,10 @@ Memory::~Memory() {
// Release associated map target, if any
if (NULL != mapMemory_) {
if (owner()->getSvmPtr() != nullptr) {
owner()->uncommitSvmMemory();
}
mapMemory()->unmap(NULL);
mapMemory_->release();
}
+4
Zobrazit soubor
@@ -385,6 +385,10 @@ Memory::~Memory() {
// Release associated map target, if any
if (nullptr != mapMemory_) {
if (owner()->getSvmPtr() != nullptr) {
owner()->uncommitSvmMemory();
}
mapMemory()->unmap(nullptr);
mapMemory_->release();
}
+8
Zobrazit soubor
@@ -431,6 +431,14 @@ void Memory::commitSvmMemory() {
}
}
void Memory::uncommitSvmMemory() {
ScopedLock lock(lockMemoryOps_);
if (svmPtrCommited_ && !(flags_ & CL_MEM_SVM_FINE_GRAIN_BUFFER)) {
amd::Os::uncommitMemory(svmHostAddress_, size_);
svmPtrCommited_ = false;
}
}
void Buffer::initDeviceMemory() {
deviceMemories_ = reinterpret_cast<DeviceMemory*>(reinterpret_cast<char*>(this) + sizeof(Buffer));
memset(deviceMemories_, 0, context_().devices().size() * sizeof(DeviceMemory));
+1
Zobrazit soubor
@@ -306,6 +306,7 @@ class Memory : public amd::RuntimeObject {
return svmPtrCommited_;
} //!< svm host address committed accessor;
void commitSvmMemory(); //!< svm host address committed accessor;
void uncommitSvmMemory();
void setCacheStatus(bool canBeCached) {
canBeCached_ = canBeCached;
} //!< set the memobject cached status;