P4 to Git Change 1503305 by gandryey@gera-w8 on 2018/01/12 18:09:51

SWDEV-142224 - [OCL] OCL runtime hang in multithread app with extended tests
	- Lock the resource cache only if a resource will be placed into the cache. Views, allocated/destroyed dynamically on the queues, won't be placed into the cache and lock should not be called for them

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#46 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#15 edit
Αυτή η υποβολή περιλαμβάνεται σε:
foreman
2018-01-12 18:15:39 -05:00
γονέας 074f37ac4d
υποβολή ec29b52ae8
2 αρχεία άλλαξαν με 3 προσθήκες και 3 διαγραφές
@@ -1837,7 +1837,6 @@ ResourceCache::~ResourceCache() { free(); }
//! \note the cache works in FILO mode
bool ResourceCache::addGpuMemory(Resource::Descriptor* desc, GpuMemoryReference* ref) {
amd::ScopedLock l(&lockCacheOps_);
bool result = false;
size_t size = ref->iMem()->Desc().size;
@@ -1845,6 +1844,7 @@ bool ResourceCache::addGpuMemory(Resource::Descriptor* desc, GpuMemoryReference*
if (((desc->type_ == Resource::Local) || (desc->type_ == Resource::Persistent) ||
(desc->type_ == Resource::Remote) || (desc->type_ == Resource::RemoteUSWC)) &&
(size < cacheSizeLimit_) && !desc->SVMRes_) {
amd::ScopedLock l(&lockCacheOps_);
// Validate the cache size limit. Loop until we have enough space
while ((cacheSize_ + size) > cacheSizeLimit_) {
removeLast();