P4 to Git Change 1381244 by gandryey@gera-w8 on 2017/03/03 17:58:38

SWDEV-107546 - [ROCm CQE][OCL][LC/HSAIL][mGPU][G] WF conf test "Buffers" fails in mGPU configs
	- Add MGPU coherency layer support

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.hpp#5 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#42 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#17 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#12 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.hpp#6 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#32 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#125 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#99 edit


[ROCm/clr commit: 8a1b72640a]
This commit is contained in:
foreman
2017-03-03 18:02:55 -05:00
parent 1cb396361b
commit b03a26d066
9 changed files with 542 additions and 140 deletions
@@ -125,6 +125,9 @@ Memory::Memory(
parent_->retain();
parent_->isParent_ = true;
if (parent.getHostMem() != nullptr) {
setHostMem(reinterpret_cast<address>(parent.getHostMem()) + origin);
}
// Inherit memory flags from the parent
if ((flags_ & (CL_MEM_READ_WRITE | CL_MEM_READ_ONLY |
CL_MEM_WRITE_ONLY)) == 0) {
@@ -407,7 +410,7 @@ Memory::~Memory()
// Release the parent.
if (NULL != parent_) {
// Update cache if runtime destroys a subbuffer
if (NULL != parent_->getHostMem()) {
if (NULL != parent_->getHostMem() && (vDev_ == NULL)) {
cacheWriteBack();
}
parent_->removeSubBuffer(this);
@@ -567,8 +570,9 @@ Pipe::initDeviceMemory()
Image::Image(
const Format& format,
Image& parent,
uint baseMipLevel)
: Memory(parent, 0, 0, parent.getWidth() * parent.getHeight() *
uint baseMipLevel,
cl_mem_flags flags)
: Memory(parent, flags, 0, parent.getWidth() * parent.getHeight() *
parent.getDepth() * format.getElementSize())
, impl_(format, Coord3D(parent.getWidth() *
parent.getImageFormat().getElementSize() /
@@ -1193,12 +1197,13 @@ Image::createView(
const Context& context,
const Format& format,
device::VirtualDevice* vDev,
uint baseMipLevel)
uint baseMipLevel,
cl_mem_flags flags)
{
Image* view = NULL;
// Find the image dimensions and create a corresponding object
view = new (context) Image(format, *this, baseMipLevel);
view = new (context) Image(format, *this, baseMipLevel, flags);
// Set GPU virtual device for this view
view->setVirtualDevice(vDev);