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

[SYCL] Add test for memory clock rate and bus width queries #1386

Merged
merged 1 commit into from
Nov 17, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// REQUIRES: level_zero, level_zero_dev_kit
//
// RUN: %clangxx -fsycl -fsycl-targets=%sycl_triple %level_zero_options %s -o %t.out
// RUN: %GPU_RUN_PLACEHOLDER %t.out 2>&1 %GPU_CHECK_PLACEHOLDER
//
// The test is to check that the memory clock rate and bus width is reported be
// Level Zero backend
//
// CHECK: Memory clock rate
// CHECK: Memory bus width

#include <iostream>
#include <sycl/sycl.hpp>
using namespace sycl;

int main() {

queue Queue;
auto dev = Queue.get_device();
std::cout << "Device: " << dev.get_info<info::device::name>() << std::endl;

if (dev.has(aspect::ext_intel_memory_clock_rate)) {
auto MemoryClockRate =
dev.get_info<ext::intel::info::device::memory_clock_rate>();
std::cout << "Memory clock rate: " << MemoryClockRate << std::endl;
} else {
std::cout << "Query ext_intel_device_info_memory_clock_rate not supported "
"by the device"
<< std::endl;
}

if (dev.has(aspect::ext_intel_memory_bus_width)) {
auto MemoryBusWidth =
dev.get_info<ext::intel::info::device::memory_bus_width>();
std::cout << "Memory bus width: " << MemoryBusWidth << std::endl;
} else {
std::cout << "Query ext_intel_device_info_memory_bus_width not supported "
"by the device"
<< std::endl;
}

return 0;
}