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

Commit 7d6694e

Browse files
[SYCL] Add support for sycl::ext::oneapi::property::queue::use_priority (#1414)
1 parent 80d18fc commit 7d6694e

File tree

1 file changed

+42
-0
lines changed

1 file changed

+42
-0
lines changed
Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
// REQUIRES: gpu, level_zero, level_zero_dev_kit
2+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
3+
// RUN: env ZE_DEBUG=-1 %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER
4+
//
5+
// Check that queue priority is passed to Level Zero runtime
6+
// This is the last value in the ZE_STRUCTURE_TYPE_COMMAND_QUEUE_DESC
7+
//
8+
#include <sycl/sycl.hpp>
9+
10+
void test(sycl::property_list Props) {
11+
sycl::queue Q(Props);
12+
(void)Q.submit([&](sycl::handler &CGH) {
13+
CGH.single_task<class EmptyKernel>([=]() {});
14+
});
15+
Q.wait();
16+
}
17+
18+
int main(int Argc, const char *Argv[]) {
19+
20+
// CHECK: [getZeQueue]: create queue {{.*}} priority = Normal
21+
test(sycl::property_list{});
22+
23+
// CHECK: [getZeQueue]: create queue {{.*}} priority = Normal
24+
test({sycl::ext::oneapi::property::queue::priority_normal{}});
25+
26+
// CHECK: [getZeQueue]: create queue {{.*}} priority = Low
27+
test({sycl::ext::oneapi::property::queue::priority_low{}});
28+
29+
// CHECK: [getZeQueue]: create queue {{.*}} priority = High
30+
test({sycl::ext::oneapi::property::queue::priority_high{}});
31+
32+
// CHECK: Queue cannot be constructed with different priorities.
33+
try {
34+
test({sycl::ext::oneapi::property::queue::priority_low{},
35+
sycl::ext::oneapi::property::queue::priority_high{}});
36+
} catch (sycl::exception &E) {
37+
std::cerr << E.what() << std::endl;
38+
}
39+
40+
std::cout << "The test passed." << std::endl;
41+
return 0;
42+
}

0 commit comments

Comments
 (0)