P4 to Git Change 1985445 by skudchad@skudchad_test2_win_opencl on 2019/08/19 17:35:03

SWDEV-198861 - Implement VDI equivalent to HCC_SERIALIZE_KERNEL/HCC_SERIALIZE_COPY
	- Use env var AMD_SERIALIZE_COPY/AMD_SERIALIZE_KERNEL
	0x1 - Wait for complete before command is submitted
	0x2 - Wait for complete after submission
	0x3 - Wait both

	ReviewBoardURL = http://ocltc.amd.com/reviews/r/17843/diff/

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#95 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.hpp#93 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#30 edit
... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#316 edit
This commit is contained in:
foreman
2019-08-19 17:39:27 -04:00
orang tua 26ee9da942
melakukan d4caaa51a2
4 mengubah file dengan 48 tambahan dan 24 penghapusan
+7 -4
Melihat File
@@ -187,14 +187,16 @@ bool Event::notifyCmdQueue() {
const Event::EventWaitList Event::nullWaitList(0);
Command::Command(HostQueue& queue, cl_command_type type, const EventWaitList& eventWaitList)
Command::Command(HostQueue& queue, cl_command_type type,
const EventWaitList& eventWaitList, uint32_t commandWaitBits)
: Event(queue),
queue_(&queue),
next_(NULL),
type_(type),
exception_(0),
data_(NULL),
eventWaitList_(eventWaitList) {
eventWaitList_(eventWaitList),
commandWaitBits_(commandWaitBits) {
// Retain the commands from the event wait list.
std::for_each(eventWaitList.begin(), eventWaitList.end(), std::mem_fun(&Command::retain));
}
@@ -218,7 +220,8 @@ void Command::enqueue() {
}
queue_->append(*this);
queue_->flush();
if (queue_->device().settings().waitCommand_ && (type_ != 0)) {
if ((queue_->device().settings().waitCommand_ && (type_ != 0)) ||
((commandWaitBits_ & 0x2) != 0)) {
awaitCompletion();
}
}
@@ -228,7 +231,7 @@ const Context& Command::context() const { return queue_->context(); }
NDRangeKernelCommand::NDRangeKernelCommand(HostQueue& queue, const EventWaitList& eventWaitList,
Kernel& kernel, const NDRangeContainer& sizes,
uint32_t sharedMemBytes, uint32_t extraParam)
: Command(queue, CL_COMMAND_NDRANGE_KERNEL, eventWaitList)
: Command(queue, CL_COMMAND_NDRANGE_KERNEL, eventWaitList, AMD_SERIALIZE_KERNEL)
, kernel_(kernel)
, sizes_(sizes)
, sharedMemBytes_(sharedMemBytes)