File tree Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Expand file tree Collapse file tree 2 files changed +14
-15
lines changed Original file line number Diff line number Diff line change @@ -203,25 +203,23 @@ event handler::finalize() {
203
203
break ;
204
204
case detail::CG::NONE:
205
205
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. "
207
207
<< std::endl;
208
208
}
209
- break ;
209
+ detail::EventImplPtr Event =
210
+ std::make_shared<cl::sycl::detail::event_impl>();
211
+ MLastEvent = detail::createSyclObjFromImpl<event>(Event);
212
+ return MLastEvent;
210
213
}
211
214
212
- detail::EventImplPtr Event;
213
-
214
215
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));
225
223
226
224
MLastEvent = detail::createSyclObjFromImpl<event>(Event);
227
225
return MLastEvent;
Original file line number Diff line number Diff line change @@ -28,7 +28,8 @@ int main() {
28
28
queue q (asyncHandler);
29
29
30
30
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
32
33
event e = q.submit ([&](handler &cgh) {});
33
34
34
35
e.wait_and_throw ();
You can’t perform that action at this time.
0 commit comments