Skip to content

Commit b77c9a3

Browse files
committed
Addressed review comments
1 parent 5d51865 commit b77c9a3

File tree

2 files changed

+14
-15
lines changed

2 files changed

+14
-15
lines changed

sycl/source/handler.cpp

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -203,25 +203,23 @@ event handler::finalize() {
203203
break;
204204
case detail::CG::NONE:
205205
if (detail::pi::trace(detail::pi::TraceLevel::PI_TRACE_ALL)) {
206-
std::cout << "The empty command group is supported by sycl2020"
206+
std::cout << "An empty command group is supported by SYCL 2020."
207207
<< std::endl;
208208
}
209-
break;
209+
detail::EventImplPtr Event =
210+
std::make_shared<cl::sycl::detail::event_impl>();
211+
MLastEvent = detail::createSyclObjFromImpl<event>(Event);
212+
return MLastEvent;
210213
}
211214

212-
detail::EventImplPtr Event;
213-
214215
if (!CommandGroup) {
215-
if (getType() != detail::CG::NONE)
216-
throw sycl::runtime_error(
217-
"Internal Error. Command group cannot be constructed.",
218-
PI_INVALID_OPERATION);
219-
else
220-
// empty cg is supported by sycl2020
221-
Event = std::make_shared<cl::sycl::detail::event_impl>();
222-
} else
223-
Event = detail::Scheduler::getInstance().addCG(std::move(CommandGroup),
224-
std::move(MQueue));
216+
throw sycl::runtime_error(
217+
"Internal Error. Command group cannot be constructed.",
218+
PI_INVALID_OPERATION);
219+
}
220+
221+
detail::EventImplPtr Event = detail::Scheduler::getInstance().addCG(
222+
std::move(CommandGroup), std::move(MQueue));
225223

226224
MLastEvent = detail::createSyclObjFromImpl<event>(Event);
227225
return MLastEvent;

sycl/test/basic_tests/event_async_exception.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,8 @@ int main() {
2828
queue q(asyncHandler);
2929

3030
try {
31-
// Submit a CG with no kernel or memory operation no trigger an async error
31+
// Check that submitting a CG with no kernel or memory operation doesn't produce
32+
// an async exception
3233
event e = q.submit([&](handler &cgh) {});
3334

3435
e.wait_and_throw();

0 commit comments

Comments
 (0)