Skip to content

[SYCL] Don't print vendor in sycl-ls' output #12275

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 2 commits into from
Jan 5, 2024
Merged
Show file tree
Hide file tree
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
25 changes: 25 additions & 0 deletions sycl/include/sycl/backend_types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,5 +65,30 @@ inline std::ostream &operator<<(std::ostream &Out, backend be) {
return Out;
}

namespace detail {
inline std::string_view get_backend_name_no_vendor(backend Backend) {
switch (Backend) {
case backend::host:
return "host";
case backend::opencl:
return "opencl";
case backend::ext_oneapi_level_zero:
return "level_zero";
case backend::ext_oneapi_cuda:
return "cuda";
case backend::ext_intel_esimd_emulator:
return "esimd_emulator";
case backend::ext_oneapi_hip:
return "hip";
case backend::ext_oneapi_native_cpu:
return "native_cpu";
case backend::all:
return "all";
}

return "";
}
} // namespace detail

} // namespace _V1
} // namespace sycl
5 changes: 3 additions & 2 deletions sycl/tools/sycl-ls/sycl-ls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,9 @@ int main(int argc, char **argv) {
// plugin.

for (const auto &Device : Devices) {
std::cout << "[" << Backend << ":" << getDeviceTypeName(Device) << ":"
<< DeviceNums[Backend] << "] ";
std::cout << "[" << detail::get_backend_name_no_vendor(Backend) << ":"
<< getDeviceTypeName(Device) << ":" << DeviceNums[Backend]
<< "] ";
++DeviceNums[Backend];
// Verbose parameter is set to false to print regular devices output
// first
Expand Down