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

Commit 4365f38

Browse files
authored
[SYCL] Add test for memory clock rate and bus width queries (#1386)
1 parent 5d63e2a commit 4365f38

File tree

1 file changed

+43
-0
lines changed

1 file changed

+43
-0
lines changed
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
// REQUIRES: level_zero, level_zero_dev_kit
2+
//
3+
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
4+
// RUN: %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER
5+
//
6+
// The test is to check that the memory clock rate and bus width is reported be
7+
// Level Zero backend
8+
//
9+
// CHECK: Memory clock rate
10+
// CHECK: Memory bus width
11+
12+
#include <iostream>
13+
#include <sycl/sycl.hpp>
14+
using namespace sycl;
15+
16+
int main() {
17+
18+
queue Queue;
19+
auto dev = Queue.get_device();
20+
std::cout << "Device: " << dev.get_info<info::device::name>() << std::endl;
21+
22+
if (dev.has(aspect::ext_intel_memory_clock_rate)) {
23+
auto MemoryClockRate =
24+
dev.get_info<ext::intel::info::device::memory_clock_rate>();
25+
std::cout << "Memory clock rate: " << MemoryClockRate << std::endl;
26+
} else {
27+
std::cout << "Query ext_intel_device_info_memory_clock_rate not supported "
28+
"by the device"
29+
<< std::endl;
30+
}
31+
32+
if (dev.has(aspect::ext_intel_memory_bus_width)) {
33+
auto MemoryBusWidth =
34+
dev.get_info<ext::intel::info::device::memory_bus_width>();
35+
std::cout << "Memory bus width: " << MemoryBusWidth << std::endl;
36+
} else {
37+
std::cout << "Query ext_intel_device_info_memory_bus_width not supported "
38+
"by the device"
39+
<< std::endl;
40+
}
41+
42+
return 0;
43+
}

0 commit comments

Comments
 (0)