File tree Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Expand file tree Collapse file tree 2 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -70,16 +70,19 @@ event::get_info<info::event::command_execution_status>() const {
70
70
template <>
71
71
cl_ulong
72
72
event::get_profiling_info<info::event_profiling::command_submit>() const {
73
+ impl->wait (impl);
73
74
return impl->get_profiling_info <info::event_profiling::command_submit>();
74
75
}
75
76
template <>
76
77
cl_ulong
77
78
event::get_profiling_info<info::event_profiling::command_start>() const {
79
+ impl->wait (impl);
78
80
return impl->get_profiling_info <info::event_profiling::command_start>();
79
81
}
80
82
81
83
template <>
82
84
cl_ulong event::get_profiling_info<info::event_profiling::command_end>() const {
85
+ impl->wait (impl);
83
86
return impl->get_profiling_info <info::event_profiling::command_end>();
84
87
}
85
88
Original file line number Diff line number Diff line change
1
+ // RUN: %clang -std=c++11 -fsycl %s -o %t.out -lstdc++ -lOpenCL -lsycl
2
+ // RUN: env SYCL_DEVICE_TYPE=HOST %t.out
3
+ // RUN: %CPU_RUN_PLACEHOLDER %t.out
4
+ // RUN: %GPU_RUN_PLACEHOLDER %t.out
5
+ // RUN: %ACC_RUN_PLACEHOLDER %t.out
6
+ // ==------------------- event_profiling_info.cpp ---------------------------==//
7
+ //
8
+ // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
9
+ // See https://llvm.org/LICENSE.txt for license information.
10
+ // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
11
+ //
12
+ // ===----------------------------------------------------------------------===//
13
+
14
+ #include < CL/sycl.hpp>
15
+
16
+ using namespace cl ;
17
+
18
+ // The test checks that get_profiling_info waits for command asccociated with
19
+ // event to complete execution.
20
+ int main () {
21
+ sycl::queue Q{sycl::property::queue::enable_profiling ()};
22
+ sycl::event Event = Q.submit ([&](sycl::handler &CGH) {
23
+ CGH.single_task <class EmptyKernel >([=]() {});
24
+ });
25
+
26
+ Event.get_profiling_info <sycl::info::event_profiling::command_start>();
27
+
28
+ bool Fail = sycl::info::event_command_status::complete !=
29
+ Event.get_info <sycl::info::event::command_execution_status>();
30
+
31
+ return Fail;
32
+ }
You can’t perform that action at this time.
0 commit comments