From 9294b521bc882bc3163cb8a910b0db440aff783e Mon Sep 17 00:00:00 2001
From: foreman
Date: Mon, 19 Nov 2018 15:46:09 -0500
Subject: [PATCH] P4 to Git Change 1709028 by
skudchad@skudchad_test2_win_opencl on 2018/11/19 15:15:09
SWDEV-145570 - [HIP] Fix a bug in event tracking
ReviewBoardURL = http://ocltc.amd.com/reviews/r/16182/diff/
Affected files ...
... //depot/stg/opencl/drivers/opencl/api/hip/hip_event.cpp#8 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/commandqueue.cpp#29 edit
---
rocclr/runtime/platform/commandqueue.cpp | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/rocclr/runtime/platform/commandqueue.cpp b/rocclr/runtime/platform/commandqueue.cpp
index 2990271e18..95ed258551 100644
--- a/rocclr/runtime/platform/commandqueue.cpp
+++ b/rocclr/runtime/platform/commandqueue.cpp
@@ -184,6 +184,10 @@ void HostQueue::setLastQueuedCommand(Command* lastCommand) {
Command* HostQueue::getLastQueuedCommand(bool retain) {
// Get last submitted command
ScopedLock sl(queueLock_);
+ if (lastEnqueueCommand_ == nullptr) {
+ return nullptr;
+ }
+
if (retain) {
lastEnqueueCommand_->retain();
}