1
- // XFAIL: cuda, opencl, level_zero
2
1
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %s -o %t.out
3
2
//
4
3
// RUN: env SYCL_DEVICE_TYPE=HOST %t.out
@@ -29,10 +28,10 @@ bool verifyProfiling(event Event) {
29
28
assert (Submit <= Start);
30
29
assert (Start <= End);
31
30
32
- bool Fail = sycl::info::event_command_status::complete ! =
31
+ bool Pass = sycl::info::event_command_status::complete = =
33
32
Event.get_info <sycl::info::event::command_execution_status>();
34
33
35
- return Fail ;
34
+ return Pass ;
36
35
}
37
36
38
37
// The test checks that get_profiling_info waits for command asccociated with
@@ -45,28 +44,32 @@ int main() {
45
44
}
46
45
int Values[Size] = {0 };
47
46
48
- buffer<int , 1 > BufferFrom (Data, range<1 >(Size));
49
- buffer<int , 1 > BufferTo (Values, range<1 >(Size));
47
+ {
48
+ buffer<int , 1 > BufferFrom (Data, range<1 >(Size));
49
+ buffer<int , 1 > BufferTo (Values, range<1 >(Size));
50
50
51
- // buffer copy
52
- queue copyQueue{sycl::property::queue::enable_profiling ()};
53
- event copyEvent = copyQueue.submit ([&](sycl::handler &Cgh) {
54
- accessor<int , 1 , access::mode::read, access::target::global_buffer>
55
- AccessorFrom (BufferFrom, Cgh, range<1 >(Size));
56
- accessor<int , 1 , access::mode::write, access::target::global_buffer>
57
- AccessorTo (BufferTo, Cgh, range<1 >(Size));
58
- Cgh.copy (AccessorFrom, AccessorTo);
59
- });
51
+ // buffer copy
52
+ queue copyQueue{sycl::property::queue::enable_profiling ()};
53
+ event copyEvent = copyQueue.submit ([&](sycl::handler &Cgh) {
54
+ accessor<int , 1 , access::mode::read, access::target::global_buffer>
55
+ AccessorFrom (BufferFrom, Cgh, range<1 >(Size));
56
+ accessor<int , 1 , access::mode::write, access::target::global_buffer>
57
+ AccessorTo (BufferTo, Cgh, range<1 >(Size));
58
+ Cgh.copy (AccessorFrom, AccessorTo);
59
+ });
60
+
61
+ // kernel launch
62
+ queue kernelQueue{sycl::property::queue::enable_profiling ()};
63
+ event kernelEvent = kernelQueue.submit ([&](sycl::handler &CGH) {
64
+ CGH.single_task <class EmptyKernel >([=]() {});
65
+ });
66
+
67
+ assert (verifyProfiling (copyEvent) && verifyProfiling (kernelEvent));
68
+ }
60
69
61
70
for (size_t I = 0 ; I < Size; ++I) {
62
71
assert (Data[I] == Values[I]);
63
72
}
64
73
65
- // kernel launch
66
- queue kernelQueue{sycl::property::queue::enable_profiling ()};
67
- event kernelEvent = kernelQueue.submit ([&](sycl::handler &CGH) {
68
- CGH.single_task <class EmptyKernel >([=]() {});
69
- });
70
-
71
- return verifyProfiling (copyEvent) || verifyProfiling (kernelEvent);
74
+ return 0 ;
72
75
}
0 commit comments