@@ -759,7 +759,6 @@ void Command::makeTraceEventEpilog() {
759
759
760
760
Command *Command::processDepEvent (EventImplPtr DepEvent, const DepDesc &Dep,
761
761
std::vector<Command *> &ToCleanUp) {
762
- const ContextImplPtr &WorkerContext = getWorkerContext ();
763
762
764
763
// 1. Non-host events can be ignored if they are not fully initialized.
765
764
// 2. Some types of commands do not produce UR events after they are
@@ -780,8 +779,9 @@ Command *Command::processDepEvent(EventImplPtr DepEvent, const DepDesc &Dep,
780
779
Command *ConnectionCmd = nullptr ;
781
780
782
781
context_impl &DepEventContext = DepEvent->getContextImpl ();
782
+ context_impl *WorkerContext = getWorkerContext ();
783
783
// If contexts don't match we'll connect them using host task
784
- if (&DepEventContext != WorkerContext. get () && WorkerContext) {
784
+ if (&DepEventContext != WorkerContext && WorkerContext) {
785
785
Scheduler::GraphBuilder &GB = Scheduler::getInstance ().MGraphBuilder ;
786
786
ConnectionCmd = GB.connectDepEvent (this , DepEvent, Dep, ToCleanUp);
787
787
} else
@@ -790,10 +790,10 @@ Command *Command::processDepEvent(EventImplPtr DepEvent, const DepDesc &Dep,
790
790
return ConnectionCmd;
791
791
}
792
792
793
- ContextImplPtr Command::getWorkerContext () const {
793
+ context_impl * Command::getWorkerContext () const {
794
794
if (!MQueue)
795
795
return nullptr ;
796
- return MQueue->getContextImplPtr ();
796
+ return & MQueue->getContextImpl ();
797
797
}
798
798
799
799
bool Command::producesPiEvent () const { return true ; }
@@ -1547,10 +1547,10 @@ void MemCpyCommand::emitInstrumentationData() {
1547
1547
#endif
1548
1548
}
1549
1549
1550
- ContextImplPtr MemCpyCommand::getWorkerContext () const {
1550
+ context_impl * MemCpyCommand::getWorkerContext () const {
1551
1551
if (!MWorkerQueue)
1552
1552
return nullptr ;
1553
- return MWorkerQueue->getContextImplPtr ();
1553
+ return & MWorkerQueue->getContextImpl ();
1554
1554
}
1555
1555
1556
1556
bool MemCpyCommand::producesPiEvent () const {
@@ -1720,10 +1720,10 @@ void MemCpyCommandHost::emitInstrumentationData() {
1720
1720
#endif
1721
1721
}
1722
1722
1723
- ContextImplPtr MemCpyCommandHost::getWorkerContext () const {
1723
+ context_impl * MemCpyCommandHost::getWorkerContext () const {
1724
1724
if (!MWorkerQueue)
1725
1725
return nullptr ;
1726
- return MWorkerQueue->getContextImplPtr ();
1726
+ return & MWorkerQueue->getContextImpl ();
1727
1727
}
1728
1728
1729
1729
ur_result_t MemCpyCommandHost::enqueueImp () {
0 commit comments