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
This commit is contained in:
foreman
2018-01-12 18:15:39 -05:00
parent 074f37ac4d
commit ec29b52ae8
2 ha cambiato i file con 3 aggiunte e 3 eliminazioni
+1 -1
Vedi File
@@ -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();
+2 -2
Vedi File
@@ -478,8 +478,8 @@ class ResourceCache : public amd::HeapObject {
amd::Monitor lockCacheOps_; //!< Lock to serialise cache access
size_t cacheSize_; //!< Current cache size in bytes
size_t cacheSizeLimit_; //!< Cache size limit in bytes
size_t cacheSize_; //!< Current cache size in bytes
const size_t cacheSizeLimit_; //!< Cache size limit in bytes
//! CAL resource cache
std::list<std::pair<Resource::Descriptor*, GpuMemoryReference*> > resCache_;