P4 to Git Change 1114824 by gandryey@gera-dev-w7 on 2015/01/23 14:01:28
EPR #410560 - Forum: [169727] Bug? CL_MEM_COPY_HOST_PTR is not thread safe - Add extra condition for the scratch unbinding Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.cpp#349 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#126 edit
This commit is contained in:
@@ -642,7 +642,8 @@ VirtualGPU::~VirtualGPU()
|
|||||||
gslKernels_.clear();
|
gslKernels_.clear();
|
||||||
|
|
||||||
// Destroy all memories
|
// Destroy all memories
|
||||||
releaseMemObjects();
|
static const bool SkipScratch = false;
|
||||||
|
releaseMemObjects(SkipScratch);
|
||||||
|
|
||||||
// Destroy printf object
|
// Destroy printf object
|
||||||
delete printfDbg_;
|
delete printfDbg_;
|
||||||
@@ -2885,7 +2886,7 @@ VirtualGPU::enableSyncedBlit() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
VirtualGPU::releaseMemObjects()
|
VirtualGPU::releaseMemObjects(bool scratch)
|
||||||
{
|
{
|
||||||
for (GpuEvents::const_iterator it = gpuEvents_.begin();
|
for (GpuEvents::const_iterator it = gpuEvents_.begin();
|
||||||
it != gpuEvents_.end(); ++it) {
|
it != gpuEvents_.end(); ++it) {
|
||||||
@@ -2916,16 +2917,13 @@ VirtualGPU::releaseMemObjects()
|
|||||||
setConstantBuffer(SC_INFO_CONSTANTBUFFER, NULL, 0, 0);
|
setConstantBuffer(SC_INFO_CONSTANTBUFFER, NULL, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((dev().scratch(hwRing()) != NULL) &&
|
if (scratch) {
|
||||||
(dev().scratch(hwRing())->regNum_ > 0)) {
|
uint numBufs = (dev().settings().siPlus_) ? 1 : dev().info().numberOfShaderEngines;
|
||||||
// Unbind scratch memory
|
for (uint i = 0; i < numBufs; ++i) {
|
||||||
const std::vector<Memory*>& mems = dev().scratch(hwRing())->memObjs_;
|
setScratchBuffer(NULL, i);
|
||||||
for (uint i = 0; i < mems.size(); ++i) {
|
|
||||||
if (mems[i] != NULL) {
|
|
||||||
setScratchBuffer(NULL, i);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
gpuEvents_.clear();
|
gpuEvents_.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -382,7 +382,7 @@ public:
|
|||||||
const DmaFlushMgmt& dmaFlushMgmt() const { return dmaFlushMgmt_; }
|
const DmaFlushMgmt& dmaFlushMgmt() const { return dmaFlushMgmt_; }
|
||||||
|
|
||||||
//! Releases GSL memory objects allocated on this queue
|
//! Releases GSL memory objects allocated on this queue
|
||||||
void releaseMemObjects();
|
void releaseMemObjects(bool scratch = true);
|
||||||
|
|
||||||
//! Returns the HW ring used on this virtual device
|
//! Returns the HW ring used on this virtual device
|
||||||
uint hwRing() const { return hwRing_; }
|
uint hwRing() const { return hwRing_; }
|
||||||
|
|||||||
Reference in New Issue
Block a user