P4 to Git Change 1421208 by gandryey@gera-w8 on 2017/06/12 13:15:22
SWDEV-124171 - adding support for p2p OCL in rocm stack - Add cl_amd_copy_buffer_p2p extension for P2P transfers. The extension adds a new API entry - clEnqueueCopyBufferP2PAMD() which allows to transfer CL buffers between different CL contexts on different GPUs. If P2P isn't possible, then double copy performed - Also the app can query the P2P support capabilities for the device. A list of P2P accessible devices can be returned for the current device http://ocltc.amd.com/reviews/r/12913/ Affected files ... ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_context.cpp#54 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_device.cpp#62 edit ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_p2p_amd.cpp#1 add ... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_p2p_amd.h#1 add ... //depot/stg/opencl/drivers/opencl/api/opencl/khronos/headers/opencl2.0/CL/cl_ext.h#29 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/cpu/cpuvirtual.hpp#14 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#287 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpuvirtual.hpp#141 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.hpp#26 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocblit.cpp#19 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#54 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.hpp#22 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocmemory.cpp#24 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#19 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.cpp#39 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocvirtual.hpp#12 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#79 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#84 edit
Этот коммит содержится в:
@@ -558,4 +558,30 @@ bool TransferBufferFileCommand::validateMemory() {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool CopyMemoryP2PCommand::validateMemory() {
|
||||
if (queue()->device().info().type_ & CL_DEVICE_TYPE_GPU) {
|
||||
const std::vector<Device*>& devices = memory1_->getContext().devices();
|
||||
if (devices.size() != 1) {
|
||||
LogError("Can't allocate memory object for P2P extension");
|
||||
return false;
|
||||
}
|
||||
device::Memory* mem = memory1_->getDeviceMemory(*devices[0]);
|
||||
if (nullptr == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!", memory1_->getSize());
|
||||
return false;
|
||||
}
|
||||
const std::vector<Device*>& devices2 = memory2_->getContext().devices();
|
||||
if (devices2.size() != 1) {
|
||||
LogError("Can't allocate memory object for P2P extension");
|
||||
return false;
|
||||
}
|
||||
mem = memory2_->getDeviceMemory(*devices2[0]);
|
||||
if (nullptr == mem) {
|
||||
LogPrintfError("Can't allocate memory size - 0x%08X bytes!", memory2_->getSize());
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace amd
|
||||
|
||||
Ссылка в новой задаче
Block a user