Skip to content

Commit ac3de67

Browse files
author
Ivan Karachun
authored
[SYCL][NFC] Fixed SYCL_PI_TRACE output while selecting a device. (#2192)
Previously wrong score and wrong platform name were displayed. Signed-off-by: Ivan Karachun <[email protected]>
1 parent 2c2b5f2 commit ac3de67

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

sycl/source/device_selector.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,14 @@ device device_selector::select_device() const {
3737
int dev_score = (*this)(dev);
3838

3939
if (detail::pi::trace(detail::pi::TraceLevel::PI_TRACE_ALL)) {
40-
string_class PlatformVersion = dev.get_info<info::device::platform>()
41-
.get_info<info::platform::version>();
40+
string_class PlatformName = dev.get_info<info::device::platform>()
41+
.get_info<info::platform::name>();
4242
string_class DeviceName = dev.get_info<info::device::name>();
4343
std::cout << "SYCL_PI_TRACE[all]: "
44-
<< "select_device(): -> score = " << score
45-
<< ((score < 0) ? "(REJECTED)" : " ") << std::endl
44+
<< "select_device(): -> score = " << dev_score
45+
<< ((dev_score < 0) ? " (REJECTED)" : "") << std::endl
4646
<< "SYCL_PI_TRACE[all]: "
47-
<< " platform: " << PlatformVersion << std::endl
47+
<< " platform: " << PlatformName << std::endl
4848
<< "SYCL_PI_TRACE[all]: "
4949
<< " device: " << DeviceName << std::endl;
5050
}
@@ -67,13 +67,13 @@ device device_selector::select_device() const {
6767

6868
if (res != nullptr) {
6969
if (detail::pi::trace(detail::pi::TraceLevel::PI_TRACE_BASIC)) {
70-
string_class PlatformVersion = res->get_info<info::device::platform>()
71-
.get_info<info::platform::version>();
70+
string_class PlatformName = res->get_info<info::device::platform>()
71+
.get_info<info::platform::name>();
7272
string_class DeviceName = res->get_info<info::device::name>();
7373
std::cout << "SYCL_PI_TRACE[all]: "
7474
<< "Selected device ->" << std::endl
7575
<< "SYCL_PI_TRACE[all]: "
76-
<< " platform: " << PlatformVersion << std::endl
76+
<< " platform: " << PlatformName << std::endl
7777
<< "SYCL_PI_TRACE[all]: "
7878
<< " device: " << DeviceName << std::endl;
7979
}

0 commit comments

Comments
 (0)