Skip to content
This repository was archived by the owner on Mar 28, 2023. It is now read-only.

Commit f491aa0

Browse files
Add a test for information queries of dummy events (#201)
1 parent 7d619fe commit f491aa0

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

SYCL/Regression/dummy_event_info.cpp

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// RUN: %clangxx -fsycl %s -o %t.out
2+
// RUN: %CPU_RUN_PLACEHOLDER %t.out
3+
4+
#include <CL/sycl.hpp>
5+
6+
#include <cassert>
7+
8+
using namespace sycl;
9+
10+
// Check that information queries for dummy non-host events (e.g. USM operations
11+
// for 0 bytes) work correctly.
12+
int main() {
13+
queue q{{property::queue::enable_profiling()}};
14+
event e = q.memcpy(nullptr, nullptr, 0);
15+
16+
assert(e.get_info<info::event::command_execution_status>() ==
17+
info::event_command_status::complete);
18+
assert(e.get_info<info::event::reference_count>() == 0);
19+
assert(e.get_profiling_info<sycl::info::event_profiling::command_submit>() ==
20+
0);
21+
assert(e.get_profiling_info<sycl::info::event_profiling::command_start>() ==
22+
0);
23+
assert(e.get_profiling_info<sycl::info::event_profiling::command_end>() == 0);
24+
}

0 commit comments

Comments
 (0)