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
Этот коммит содержится в:
foreman
2015-01-23 14:20:22 -05:00
родитель 770a084e70
Коммит a910ebb77d
2 изменённых файлов: 9 добавлений и 11 удалений
+8 -10
Просмотреть файл
@@ -642,7 +642,8 @@ VirtualGPU::~VirtualGPU()
gslKernels_.clear();
// Destroy all memories
releaseMemObjects();
static const bool SkipScratch = false;
releaseMemObjects(SkipScratch);
// Destroy printf object
delete printfDbg_;
@@ -2885,7 +2886,7 @@ VirtualGPU::enableSyncedBlit() const
}
void
VirtualGPU::releaseMemObjects()
VirtualGPU::releaseMemObjects(bool scratch)
{
for (GpuEvents::const_iterator it = gpuEvents_.begin();
it != gpuEvents_.end(); ++it) {
@@ -2916,16 +2917,13 @@ VirtualGPU::releaseMemObjects()
setConstantBuffer(SC_INFO_CONSTANTBUFFER, NULL, 0, 0);
}
if ((dev().scratch(hwRing()) != NULL) &&
(dev().scratch(hwRing())->regNum_ > 0)) {
// Unbind scratch memory
const std::vector<Memory*>& mems = dev().scratch(hwRing())->memObjs_;
for (uint i = 0; i < mems.size(); ++i) {
if (mems[i] != NULL) {
setScratchBuffer(NULL, i);
}
if (scratch) {
uint numBufs = (dev().settings().siPlus_) ? 1 : dev().info().numberOfShaderEngines;
for (uint i = 0; i < numBufs; ++i) {
setScratchBuffer(NULL, i);
}
}
gpuEvents_.clear();
}
+1 -1
Просмотреть файл
@@ -382,7 +382,7 @@ public:
const DmaFlushMgmt& dmaFlushMgmt() const { return dmaFlushMgmt_; }
//! Releases GSL memory objects allocated on this queue
void releaseMemObjects();
void releaseMemObjects(bool scratch = true);
//! Returns the HW ring used on this virtual device
uint hwRing() const { return hwRing_; }