hipStreamAddCallback test seg faults

Change-Id: I1f107fc8a5c586cd571f0280ed8716c5f89d25b7
SWDEV-227875: Need to add a dummy marker in case the stream is empty.


[ROCm/hip commit: 3dfbfc408b]
This commit is contained in:
Christophe Paquot
2020-03-19 11:11:59 -07:00
parent 2847cdc6f0
commit 0d5638f513
+5
View File
@@ -251,6 +251,11 @@ hipError_t hipStreamAddCallback(hipStream_t stream, hipStreamCallback_t callback
amd::HostQueue* hostQueue = reinterpret_cast<hip::Stream*>
(stream)->asHostQueue();
amd::Command* command = hostQueue->getLastQueuedCommand(true);
if (command == nullptr) {
amd::Command::EventWaitList eventWaitList;
command = new amd::Marker(*hostQueue, false, eventWaitList);
command->enqueue();
}
amd::Event& event = command->event();
StreamCallback* cbo = new StreamCallback(stream, callback, userData, command);