File tree Expand file tree Collapse file tree 3 files changed +39
-20
lines changed Expand file tree Collapse file tree 3 files changed +39
-20
lines changed Original file line number Diff line number Diff line change @@ -3592,21 +3592,10 @@ ur_result_t ExecCGCommand::enqueueImpQueue() {
3592
3592
3593
3593
return UR_RESULT_SUCCESS;
3594
3594
}
3595
- case CGType::None: {
3596
- if (RawEvents.empty ()) {
3597
- // urEnqueueEventsWait with zero events acts like a barrier which is NOT
3598
- // what we want here. On the other hand, there is nothing to wait for, so
3599
- // we don't need to enqueue anything.
3600
- return UR_RESULT_SUCCESS;
3601
- }
3602
- const detail::AdapterPtr &Adapter = MQueue->getAdapter ();
3603
- ur_event_handle_t Event;
3604
- ur_result_t Result = Adapter->call_nocheck <UrApiKind::urEnqueueEventsWait>(
3605
- MQueue->getHandleRef (), RawEvents.size (),
3606
- RawEvents.size () ? &RawEvents[0 ] : nullptr , &Event);
3607
- MEvent->setHandle (Event);
3608
- return Result;
3609
- }
3595
+ case CGType::None:
3596
+ throw sycl::exception (sycl::make_error_code (sycl::errc::runtime),
3597
+ " CG type not implemented. " +
3598
+ codeToString (UR_RESULT_ERROR_INVALID_OPERATION));
3610
3599
}
3611
3600
return UR_RESULT_ERROR_INVALID_OPERATION;
3612
3601
}
Original file line number Diff line number Diff line change @@ -496,8 +496,21 @@ event handler::finalize() {
496
496
MCodeLoc));
497
497
break ;
498
498
case detail::CGType::None:
499
- CommandGroup.reset (new detail::CG (detail::CGType::None,
500
- std::move (impl->CGData ), MCodeLoc));
499
+ if (detail::ur::trace (detail::ur::TraceLevel::TRACE_ALL)) {
500
+ std::cout << " WARNING: An empty command group is submitted." << std::endl;
501
+ }
502
+
503
+ // Empty nodes are handled by Graph like standard nodes
504
+ // For Standard mode (non-graph),
505
+ // empty nodes are not sent to the scheduler to save time
506
+ if (impl->MGraph || (MQueue && MQueue->getCommandGraph ())) {
507
+ CommandGroup.reset (new detail::CG (detail::CGType::None,
508
+ std::move (impl->CGData ), MCodeLoc));
509
+ } else {
510
+ detail::EventImplPtr Event = std::make_shared<sycl::detail::event_impl>();
511
+ MLastEvent = detail::createSyclObjFromImpl<event>(Event);
512
+ return MLastEvent;
513
+ }
501
514
break ;
502
515
}
503
516
Original file line number Diff line number Diff line change @@ -26,11 +26,18 @@ void test_host_task_dep() {
26
26
auto empty_cg_event =
27
27
q.submit ([&](handler &cgh) { cgh.depends_on (host_event); });
28
28
29
+ // FIXME: This should deadlock, but the dependency is ignored currently.
30
+ empty_cg_event.wait ();
31
+
29
32
assert (x == 0 );
30
33
start_execution.count_down ();
31
34
32
35
empty_cg_event.wait ();
33
- assert (x == 42 );
36
+ // FIXME: uncomment once the bug mentioned above is fixed.
37
+ // assert(x == 42);
38
+
39
+ // I'm seeing some weird hang without this:
40
+ host_event.wait ();
34
41
}
35
42
36
43
void test_device_event_dep () {
@@ -46,12 +53,17 @@ void test_device_event_dep() {
46
53
auto empty_cg_event =
47
54
q.submit ([&](handler &cgh) { cgh.depends_on (device_event); });
48
55
56
+ // FIXME: This should deadlock, but the dependency is ignored currently.
57
+ empty_cg_event.wait ();
58
+
49
59
assert (*p == 0 );
50
60
start_execution.count_down ();
51
61
52
62
empty_cg_event.wait ();
53
- assert (*p == 42 );
63
+ // FIXME: uncomment once the bug mentioned above is fixed.
64
+ // assert(*p == 42);
54
65
66
+ q.wait ();
55
67
sycl::free (p, q);
56
68
}
57
69
@@ -78,12 +90,17 @@ void test_accessor_dep() {
78
90
auto empty_cg_event =
79
91
q.submit ([&](handler &cgh) { sycl::accessor a{b, cgh}; });
80
92
93
+ // FIXME: This should deadlock, but the dependency is ignored currently.
94
+ empty_cg_event.wait ();
95
+
81
96
assert (*p == 0 );
82
97
start_execution.count_down ();
83
98
84
99
empty_cg_event.wait ();
85
- assert (*p == 42 );
100
+ // FIXME: uncomment once the bug mentioned above is fixed.
101
+ // assert(*p == 42);
86
102
103
+ q.wait ();
87
104
sycl::free (p, q);
88
105
}
89
106
You can’t perform that action at this time.
0 commit comments