P4 to Git Change 1453901 by gandryey@gera-w8 on 2017/08/31 14:34:49

SWDEV-86035 - Code clean-up
	- Use TS check first to avoid LogError
	- Reset VirtualGPU reference if resource was cached
	- Lock active VirtualGPU on release, since a cached resource can have access to that queue from another thread

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#32 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#54 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#30 edit
Этот коммит содержится в:
foreman
2017-08-31 14:50:36 -04:00
родитель 2b07a14f50
Коммит 38c1488dfd
3 изменённых файлов: 4 добавлений и 2 удалений
+3
Просмотреть файл
@@ -158,6 +158,7 @@ GpuMemoryReference::~GpuMemoryReference() {
}
}
} else {
amd::ScopedLock l(gpu_->execution());
gpu_->releaseMemory(this, &events_[gpu_->index()]);
}
if (device_.vgpus().size() != 0) {
@@ -1097,6 +1098,7 @@ void Resource::free() {
}
}
else {
amd::ScopedLock l(memRef_->gpu_->execution());
memRef_->gpu_->waitForEvent(&memRef_->events_[memRef_->gpu_->index()]);
}
}
@@ -1975,6 +1977,7 @@ bool ResourceCache::addGpuMemory(Resource::Descriptor* desc, GpuMemoryReference*
// Add the current resource to the cache
resCache_.push_front(std::make_pair(descCached, ref));
ref->gpu_ = nullptr;
cacheSize_ += size;
result = true;
}
-1
Просмотреть файл
@@ -2281,7 +2281,6 @@ void VirtualGPU::submitMarker(amd::Marker& vcmd) {
}
void VirtualGPU::releaseMemory(GpuMemoryReference* mem, GpuEvent* event) {
waitForEvent(event);
queues_[MainEngine]->removeCmdMemRef(mem);
queues_[SdmaEngine]->removeCmdMemRef(mem);
}
+1 -1
Просмотреть файл
@@ -104,7 +104,7 @@ class VirtualGPU : public device::VirtualDevice {
if (!ibReuse) {
start = amd::Os::timeNanos();
}
while (ibReuse || (Pal::Result::Success != (result = iCmdFences_[cbId]->GetStatus()))) {
while ((Pal::Result::Success != (result = iCmdFences_[cbId]->GetStatus())) || ibReuse) {
if (result == Pal::Result::ErrorFenceNeverSubmitted) {
result = Pal::Result::Success;
break;