Skip to content

Commit 7b72320

Browse files
committed
Address review comments
1 parent 31b8bf3 commit 7b72320

File tree

2 files changed

+8
-15
lines changed

2 files changed

+8
-15
lines changed

sycl/source/detail/event_impl.cpp

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,6 @@ const AdapterPtr &event_impl::getAdapter() {
153153
void event_impl::setStateIncomplete() { MState = HES_NotComplete; }
154154

155155
void event_impl::setContextImpl(const ContextImplPtr &Context) {
156-
MIsHostEvent = Context == nullptr;
157156
MContext = Context;
158157
}
159158

@@ -208,12 +207,7 @@ void event_impl::initHostProfilingInfo() {
208207
assert(QueuePtr->MIsProfilingEnabled && "Queue must have profiling enabled");
209208

210209
MIsProfilingEnabled = true;
211-
MHostProfilingInfo.reset(new HostProfilingInfo());
212-
if (!MHostProfilingInfo)
213-
throw sycl::exception(sycl::make_error_code(sycl::errc::runtime),
214-
"Out of host memory " +
215-
codeToString(UR_RESULT_ERROR_OUT_OF_HOST_MEMORY));
216-
210+
MHostProfilingInfo = std::make_unique<HostProfilingInfo>();
217211
device_impl &Device = QueuePtr->getDeviceImpl();
218212
MHostProfilingInfo->setDevice(&Device);
219213
}
@@ -620,9 +614,6 @@ bool event_impl::isCompleted() {
620614

621615
void event_impl::setCommand(void *Cmd) {
622616
MCommand = Cmd;
623-
auto TypedCommand = static_cast<Command *>(Cmd);
624-
if (TypedCommand)
625-
MIsHostEvent = TypedCommand->getWorkerContext() == nullptr;
626617
}
627618

628619
} // namespace detail

sycl/source/detail/scheduler/commands.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1956,13 +1956,15 @@ ExecCGCommand::ExecCGCommand(
19561956
Dependencies),
19571957
MEventNeeded(EventNeeded), MCommandGroup(std::move(CommandGroup)) {
19581958
if (MCommandGroup->getType() == detail::CGType::CodeplayHostTask) {
1959-
const auto &SubmitQueue =
1960-
static_cast<detail::CGHostTask *>(MCommandGroup.get())->MQueue;
1961-
MEvent->setSubmittedQueue(SubmitQueue);
1959+
queue_impl *SubmitQueue =
1960+
static_cast<detail::CGHostTask *>(MCommandGroup.get())->MQueue.get();
1961+
assert(SubmitQueue &&
1962+
"Host task command group must have a valid submit queue");
1963+
1964+
MEvent->setSubmittedQueue(SubmitQueue->weak_from_this());
19621965
// Initialize host profiling info if the queue has profiling enabled.
1963-
if (SubmitQueue && SubmitQueue->MIsProfilingEnabled) {
1966+
if (SubmitQueue->MIsProfilingEnabled)
19641967
MEvent->initHostProfilingInfo();
1965-
}
19661968
}
19671969
if (MCommandGroup->getType() == detail::CGType::ProfilingTag)
19681970
MEvent->markAsProfilingTagEvent();

0 commit comments

Comments
 (0)