P4 to Git Change 1781985 by gandryey@gera-win10 on 2019/05/13 11:54:40

SWDEV-189140 - Add P2P support in PAL path
	- PAL requires P2P resource open on the usage device. Add the new interface to open the resource
	- Add a hidden P2P device object creation into amd::Memory. It can be activated with OCL context that has a single device.

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/opencl/amdocl/cl_p2p_amd.cpp#2 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#337 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#134 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palmemory.cpp#25 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.cpp#74 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palresource.hpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#80 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.hpp#23 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palvirtual.cpp#133 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#126 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#93 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.cpp#136 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/memory.hpp#109 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#306 edit
Этот коммит содержится в:
foreman
2019-05-13 12:19:10 -04:00
родитель be5b5d86c3
Коммит 523b233cb0
+15 -14
Просмотреть файл
@@ -30,7 +30,8 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyBufferP2PAMD,
}
amd::HostQueue& hostQueue = *queue;
if (hostQueue.context() != srcBuffer->getContext()) {
if ((hostQueue.context() != srcBuffer->getContext()) &&
(hostQueue.context() != dstBuffer->getContext())) {
return CL_INVALID_CONTEXT;
}
@@ -42,29 +43,30 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyBufferP2PAMD,
return CL_INVALID_VALUE;
}
if (srcBuffer == dstBuffer && ((src_offset <= dst_offset && dst_offset < src_offset + cb) ||
(dst_offset <= src_offset && src_offset < dst_offset + cb))) {
if (srcBuffer == dstBuffer &&
((src_offset <= dst_offset && dst_offset < src_offset + cb) ||
(dst_offset <= src_offset && src_offset < dst_offset + cb))) {
return CL_MEM_COPY_OVERLAP;
}
amd::Command::EventWaitList eventWaitList;
if ((num_events_in_wait_list == 0 && event_wait_list != NULL)
|| (num_events_in_wait_list != 0 && event_wait_list == NULL)) {
return CL_INVALID_EVENT_WAIT_LIST;
if ((num_events_in_wait_list == 0 && event_wait_list != NULL) ||
(num_events_in_wait_list != 0 && event_wait_list == NULL)) {
return CL_INVALID_EVENT_WAIT_LIST;
}
while (num_events_in_wait_list-- > 0) {
cl_event event = *event_wait_list++;
amd::Event* amdEvent = as_amd(event);
if (!is_valid(event)) {
return CL_INVALID_EVENT_WAIT_LIST;
}
eventWaitList.push_back(amdEvent);
cl_event event = *event_wait_list++;
amd::Event* amdEvent = as_amd(event);
if (!is_valid(event)) {
return CL_INVALID_EVENT_WAIT_LIST;
}
eventWaitList.push_back(amdEvent);
}
amd::CopyMemoryP2PCommand* command =
new amd::CopyMemoryP2PCommand(hostQueue, CL_COMMAND_COPY_BUFFER, eventWaitList, *srcBuffer,
*dstBuffer, srcOffset, dstOffset, size);
*dstBuffer, srcOffset, dstOffset, size);
if (command == NULL) {
return CL_OUT_OF_HOST_MEMORY;
@@ -85,4 +87,3 @@ RUNTIME_ENTRY(cl_int, clEnqueueCopyBufferP2PAMD,
return CL_SUCCESS;
}
RUNTIME_EXIT