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
This commit is contained in:
@@ -1382,9 +1382,12 @@ Device::createMemory(amd::Memory &owner) const
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Transfer data only if OCL context has one device.
|
||||
// Cache coherency layer will update data for multiple devices
|
||||
if (!memory->isHostMemDirectAccess() && owner.asImage() &&
|
||||
owner.parent() == NULL &&
|
||||
(owner.getMemFlags() & (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR))) {
|
||||
(owner.parent() == nullptr) &&
|
||||
(owner.getMemFlags() & CL_MEM_COPY_HOST_PTR) &&
|
||||
(owner.getContext().devices().size() == 1)) {
|
||||
// To avoid recurssive call to Device::createMemory, we perform
|
||||
// data transfer to the view of the image.
|
||||
amd::Image* imageView = owner.asImage()->createView(
|
||||
@@ -1417,15 +1420,18 @@ Device::createMemory(amd::Memory &owner) const
|
||||
amd::Coord3D(0, 0, 0), imageView->getRegion(),
|
||||
0,
|
||||
0, true);
|
||||
// Release host memory for single device, since runtime copied data
|
||||
if ((owner.getMemFlags() & CL_MEM_COPY_HOST_PTR) &&
|
||||
(owner.getContext().devices().size() == 1)) {
|
||||
owner.setHostMem(nullptr);
|
||||
}
|
||||
|
||||
// Release host memory, since runtime copied data
|
||||
owner.setHostMem(nullptr);
|
||||
|
||||
imageView->release();
|
||||
}
|
||||
|
||||
// Prepin sysmem buffer for possible data synchronization between CPU and GPU
|
||||
if (!memory->isHostMemDirectAccess() && (owner.getHostMem() != nullptr)) {
|
||||
memory->pinSystemMemory(owner.getHostMem(), owner.getSize());
|
||||
}
|
||||
|
||||
if (!result) {
|
||||
delete memory;
|
||||
return NULL;
|
||||
|
||||
مرجع در شماره جدید
Block a user