P4 to Git Change 1620765 by skudchad@skudchad_test2_win_opencl on 2018/10/17 16:58:04

SWDEV-145570 - [HIP] Track last used event and use last enqueued command in a stream rather than creating a new event

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

Affected files ...

... //depot/stg/opencl/drivers/opencl/api/hip/hip_context.cpp#15 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_event.cpp#7 edit
... //depot/stg/opencl/drivers/opencl/api/hip/hip_stream.cpp#14 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/command.cpp#90 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#28 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.hpp#20 edit


[ROCm/clr commit: 19caea543c]
Tento commit je obsažen v:
foreman
2018-10-18 13:41:32 -04:00
rodič 0b565d02f2
revize 8f7e75cd2c
3 změnil soubory, kde provedl 34 přidání a 2 odebrání
+23 -2
Zobrazit soubor
@@ -21,7 +21,8 @@ HostQueue::HostQueue(Context& context, Device& device, cl_command_queue_properti
uint queueRTCUs, Priority priority)
: CommandQueue(context, device, properties,
device.info().queueProperties_ | CL_QUEUE_COMMAND_INTERCEPT_ENABLE_AMD,
queueRTCUs, priority) {
queueRTCUs, priority),
lastEnqueueCommand_(nullptr) {
if (thread_.state() >= Thread::INITIALIZED) {
ScopedLock sl(queueLock_);
thread_.start(this);
@@ -163,12 +164,32 @@ void HostQueue::append(Command& command) {
queue_.enqueue(&command);
}
bool HostQueue::isEmpty() {
// Get a snapshot of queue size
return queue_.empty();
}
void HostQueue::setLastQueuedCommand(Command* lastCommand) {
// Set last submitted command
ScopedLock sl(queueLock_);
if (lastEnqueueCommand_ != nullptr) {
lastEnqueueCommand_->release();
}
lastEnqueueCommand_ = lastCommand;
if (lastCommand != nullptr) {
lastEnqueueCommand_->retain();
}
}
Command* HostQueue::getLastQueuedCommand(bool retain) {
// Get last submitted command
ScopedLock sl(queueLock_);
if (retain) {
lastEnqueueCommand_->retain();
}
return lastEnqueueCommand_;
}
DeviceQueue::~DeviceQueue() {
delete virtualDevice_;
ScopedLock lock(context().lock());