Skip to content

[SYCL][L0] Fix BDF format on PCI query #6011

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
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
14 changes: 8 additions & 6 deletions sycl/plugins/level_zero/pi_level_zero.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2720,12 +2720,14 @@ pi_result piDeviceGetInfo(pi_device Device, pi_device_info ParamName,
}
ZesStruct<zes_pci_properties_t> ZeDevicePciProperties;
ZE_CALL(zesDevicePciGetProperties, (ZeDevice, &ZeDevicePciProperties));
std::stringstream ss;
ss << ZeDevicePciProperties.address.domain << ":"
<< ZeDevicePciProperties.address.bus << ":"
<< ZeDevicePciProperties.address.device << "."
<< ZeDevicePciProperties.address.function;
return ReturnValue(ss.str().c_str());
constexpr size_t AddressBufferSize = 13;
char AddressBuffer[AddressBufferSize];
std::snprintf(AddressBuffer, AddressBufferSize, "%04x:%02x:%02x.%01x",
ZeDevicePciProperties.address.domain,
ZeDevicePciProperties.address.bus,
ZeDevicePciProperties.address.device,
ZeDevicePciProperties.address.function);
return ReturnValue(AddressBuffer);
}
case PI_DEVICE_INFO_GPU_EU_COUNT: {
pi_uint32 count = Device->ZeDeviceProperties->numEUsPerSubslice *
Expand Down
4 changes: 2 additions & 2 deletions sycl/source/detail/device_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,8 @@ bool device_impl::has(aspect Aspect) const {
return get_info<info::device::usm_system_allocations>();
case aspect::ext_intel_pci_address:
return getPlugin().call_nocheck<detail::PiApiKind::piDeviceGetInfo>(
MDevice, PI_DEVICE_INFO_PCI_ADDRESS, sizeof(pi_device_type),
&device_type, &return_size) == PI_SUCCESS;
MDevice, PI_DEVICE_INFO_PCI_ADDRESS, 0, nullptr, &return_size) ==
PI_SUCCESS;
case aspect::ext_intel_gpu_eu_count:
return getPlugin().call_nocheck<detail::PiApiKind::piDeviceGetInfo>(
MDevice, PI_DEVICE_INFO_GPU_EU_COUNT, sizeof(pi_device_type),
Expand Down