File tree Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Expand file tree Collapse file tree 2 files changed +30
-1
lines changed Original file line number Diff line number Diff line change @@ -23,8 +23,12 @@ static Command *getCommand(const EventImplPtr &Event) {
23
23
24
24
std::vector<EventImplPtr>
25
25
Scheduler::GraphProcessor::getWaitList (EventImplPtr Event) {
26
- std::vector<EventImplPtr> Result;
27
26
Command *Cmd = getCommand (Event);
27
+ // Command can be nullptr if user creates cl::sycl::event explicitly,
28
+ // as such event is not mapped to any SYCL task.
29
+ if (!Cmd)
30
+ return {};
31
+ std::vector<EventImplPtr> Result;
28
32
for (const DepDesc &Dep : Cmd->MDeps ) {
29
33
if (Dep.MDepCommand )
30
34
Result.push_back (Dep.MDepCommand ->getEvent ());
Original file line number Diff line number Diff line change
1
+ // RUN: %clangxx -fsycl %s -o %t.out -lOpenCL
2
+ // RUN: %t.out
3
+ // ==------------------- GetWaitList.cpp ----------------------------==//
4
+ //
5
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
6
+ // See https://llvm.org/LICENSE.txt for license information.
7
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
8
+ //
9
+ // ===----------------------------------------------------------------------===//
10
+
11
+ #include < CL/sycl.hpp>
12
+
13
+ void foo () {
14
+ cl::sycl::event start;
15
+ start.wait_and_throw ();
16
+ return ;
17
+ }
18
+
19
+ int main () {
20
+ cl::sycl::queue Q;
21
+ Q.submit ([&](cl::sycl::handler &CGH) {
22
+ foo ();
23
+ });
24
+ return 0 ;
25
+ }
You can’t perform that action at this time.
0 commit comments