Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions sycl/source/handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -202,9 +202,13 @@ event handler::finalize() {
std::move(MRequirements), std::move(MEvents), MCGType, MCodeLoc));
break;
case detail::CG::NONE:
throw runtime_error("Command group submitted without a kernel or a "
"explicit memory operation.",
PI_INVALID_OPERATION);
if (detail::pi::trace(detail::pi::TraceLevel::PI_TRACE_ALL)) {
std::cout << "WARNING: An empty command group is submitted." << std::endl;
}
detail::EventImplPtr Event =
std::make_shared<cl::sycl::detail::event_impl>();
MLastEvent = detail::createSyclObjFromImpl<event>(Event);
return MLastEvent;
}

if (!CommandGroup)
Expand Down
7 changes: 4 additions & 3 deletions sycl/test/basic_tests/event_async_exception.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,13 @@ int main() {
queue q(asyncHandler);

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

e.wait_and_throw();
return 1;
} catch (runtime_error e) {
return 0;
} catch (runtime_error e) {
return 1;
}
}