|
| 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