P4 to Git Change 1529531 by gandryey@gera-w8 on 2018/03/20 11:50:12

SWDEV-79445 - OCL generic changes and code clean-up
	- Fix a regression in the AMF test and reenable the suballoc optimization. Rearrange the locks around cache field access only to avoid calling memory release under the cache lock.

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#57 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#53 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#287 edit


[ROCm/clr commit: 1f53841421]
This commit is contained in:
foreman
2018-03-20 12:01:19 -04:00
parent 583968c82f
commit d7c6bd4af1
4 changed files with 41 additions and 38 deletions
@@ -86,12 +86,12 @@ void Segment::copy(size_t offset, const void* src, size_t size) {
if (cpuAccess_ != nullptr) {
amd::Os::fastMemcpy(cpuAddress(offset), src, size);
} else {
amd::ScopedLock k(gpuAccess_->dev().xferMgr().lockXfer());
VirtualGPU& gpu = *gpuAccess_->dev().xferQueue();
Memory& xferBuf = gpuAccess_->dev().xferWrite().acquire();
size_t tmpSize = std::min(static_cast<size_t>(xferBuf.size()), size);
size_t srcOffs = 0;
while (size != 0) {
amd::ScopedLock k(gpuAccess_->dev().xferMgr().lockXfer());
xferBuf.hostWrite(&gpu, reinterpret_cast<const_address>(src) + srcOffs, 0, tmpSize);
xferBuf.partialMemCopyTo(gpu, 0, (offset + srcOffs), tmpSize, *gpuAccess_, false, true);
size -= tmpSize;