Skip to content

[SYCL][NFC] Fixed SYCL_PI_TRACE output while selecting a device. #2192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 28, 2020
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
16 changes: 8 additions & 8 deletions sycl/source/device_selector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,14 +37,14 @@ device device_selector::select_device() const {
int dev_score = (*this)(dev);

if (detail::pi::trace(detail::pi::TraceLevel::PI_TRACE_ALL)) {
string_class PlatformVersion = dev.get_info<info::device::platform>()
.get_info<info::platform::version>();
string_class PlatformName = dev.get_info<info::device::platform>()
.get_info<info::platform::name>();
string_class DeviceName = dev.get_info<info::device::name>();
std::cout << "SYCL_PI_TRACE[all]: "
<< "select_device(): -> score = " << score
<< ((score < 0) ? "(REJECTED)" : " ") << std::endl
<< "select_device(): -> score = " << dev_score
<< ((dev_score < 0) ? " (REJECTED)" : "") << std::endl
<< "SYCL_PI_TRACE[all]: "
<< " platform: " << PlatformVersion << std::endl
<< " platform: " << PlatformName << std::endl
<< "SYCL_PI_TRACE[all]: "
<< " device: " << DeviceName << std::endl;
}
Expand All @@ -67,13 +67,13 @@ device device_selector::select_device() const {

if (res != nullptr) {
if (detail::pi::trace(detail::pi::TraceLevel::PI_TRACE_BASIC)) {
string_class PlatformVersion = res->get_info<info::device::platform>()
.get_info<info::platform::version>();
string_class PlatformName = res->get_info<info::device::platform>()
.get_info<info::platform::name>();
string_class DeviceName = res->get_info<info::device::name>();
std::cout << "SYCL_PI_TRACE[all]: "
<< "Selected device ->" << std::endl
<< "SYCL_PI_TRACE[all]: "
<< " platform: " << PlatformVersion << std::endl
<< " platform: " << PlatformName << std::endl
<< "SYCL_PI_TRACE[all]: "
<< " device: " << DeviceName << std::endl;
}
Expand Down