P4 to Git Change 1069045 by gandryey@gera-dev-w7 on 2014/08/21 17:55:18

EPR #404714 - [CQE OCL][2.0][DTB]Opencl1.2 WF Conf. Math test failedon Pitcairn and Oland due to CL#1065597
	- Add a new MapCacheLock monitor to separate the map cache from the global lock

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#456 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.hpp#131 edit
Šī revīzija ir iekļauta:
foreman
2014-08-21 18:12:12 -04:00
vecāks a4bede39eb
revīzija 18b88ee095
2 mainīti faili ar 12 papildinājumiem un 4 dzēšanām
+11 -4
Parādīt failu
@@ -366,6 +366,7 @@ Device::Device()
, lockAsyncOpsForInitHeap_(NULL)
, vgpusAccess_(NULL)
, scratchAlloc_(NULL)
, mapCacheOps_(NULL)
, xferRead_(NULL)
, xferWrite_(NULL)
, vaCacheAccess_(NULL)
@@ -427,6 +428,7 @@ Device::~Device()
delete lockAsyncOpsForInitHeap_;
delete vgpusAccess_;
delete scratchAlloc_;
delete mapCacheOps_;
delete vaCacheAccess_;
delete vaCacheList_;
@@ -801,6 +803,11 @@ Device::create(CALuint ordinal)
return false;
}
mapCacheOps_ = new amd::Monitor("Map Cache Lock", true);
if (NULL == scratchAlloc_) {
return false;
}
vaCacheAccess_ = new amd::Monitor("VA Cache Ops Lock", true);
if (NULL == vaCacheAccess_) {
return false;
@@ -2190,8 +2197,8 @@ Device::findMemoryFromVA(const void* ptr, size_t* offset) const
amd::Memory*
Device::findMapTarget(size_t size) const
{
// Must be serialised. Global async is too conservative
amd::ScopedLock lk(*lockAsyncOps_);
// Must be serialised for access
amd::ScopedLock lk(*mapCacheOps_);
amd::Memory* map = NULL;
size_t minSize = 0;
@@ -2250,8 +2257,8 @@ Device::findMapTarget(size_t size) const
bool
Device::addMapTarget(amd::Memory* memory) const
{
// Must be serialised. Global async is too conservative
amd::ScopedLock lk(*lockAsyncOps_);
// Must be serialised for access
amd::ScopedLock lk(*mapCacheOps_);
//the svm memory shouldn't be cached
if (!memory->canBeCached()) {
@@ -610,6 +610,7 @@ private:
amd::Monitor* lockAsyncOpsForInitHeap_; //!< Lock to serialise all async ops on initialization heap operation
amd::Monitor* vgpusAccess_; //!< Lock to serialise virtual gpu list access
amd::Monitor* scratchAlloc_; //!< Lock to serialise scratch allocation
amd::Monitor* mapCacheOps_; //!< Lock to serialise cache for the map resources
XferBuffers* xferRead_; //!< Transfer buffers read
XferBuffers* xferWrite_; //!< Transfer buffers write