Skip to content

Commit 84d3f38

Browse files
authored
[PROTON][XPU] Fix utility function: enumDeviceUUIDs (#5387)
Signed-off-by: Anatoly Myachev <[email protected]>
1 parent eff6a02 commit 84d3f38

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

third_party/intel/backend/proton_utils.cpp

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,10 @@ extern "C" void waitOnSyclQueue(void *syclQueue) {
99

1010
// FIXME: Should it be in DeviceInfo class?
1111
// Inspired by Kineto: `XpuptiActivityProfiler.cpp`
12-
extern "C" void
13-
enumDeviceUUIDs(std::vector<std::array<uint8_t, 16>> deviceUUIDs_) {
14-
if (!deviceUUIDs_.empty()) {
12+
extern "C" void enumDeviceUUIDs(void *deviceUUIDsPtr) {
13+
auto *deviceUUIDs_ =
14+
reinterpret_cast<std::vector<std::array<uint8_t, 16>> *>(deviceUUIDsPtr);
15+
if (!deviceUUIDs_->empty()) {
1516
return;
1617
}
1718
auto platform_list = sycl::platform::get_platforms();
@@ -24,13 +25,13 @@ enumDeviceUUIDs(std::vector<std::array<uint8_t, 16>> deviceUUIDs_) {
2425
for (const auto &device : device_list) {
2526
if (device.is_gpu()) {
2627
if (device.has(sycl::aspect::ext_intel_device_info_uuid)) {
27-
deviceUUIDs_.push_back(
28+
deviceUUIDs_->push_back(
2829
device.get_info<sycl::ext::intel::info::device::uuid>());
2930
} else {
3031
std::cerr << "Warnings: UUID is not supported for this XPU device. "
3132
"The device index of records will be 0."
3233
<< std::endl;
33-
deviceUUIDs_.push_back(std::array<uint8_t, 16>{});
34+
deviceUUIDs_->push_back(std::array<uint8_t, 16>{});
3435
}
3536
}
3637
}

third_party/proton/csrc/lib/Profiler/Xpupti/XpuptiProfiler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ void CallbackCommon(pti_callback_domain domain,
275275
std::cout << std::endl;
276276
}
277277

278-
typedef void (*EnumDeviceUUIDsFunc)(std::vector<std::array<uint8_t, 16>>);
278+
typedef void (*EnumDeviceUUIDsFunc)(void *);
279279

280280
int callEnumDeviceUUIDs(const std::string &utils_cache_path) {
281281
void *handle = dlopen(xpu::PROTON_UTILS.data(), RTLD_LAZY);
@@ -294,7 +294,7 @@ int callEnumDeviceUUIDs(const std::string &utils_cache_path) {
294294
return 1;
295295
}
296296

297-
enumDeviceUUIDs(deviceUUIDs_);
297+
enumDeviceUUIDs(&deviceUUIDs_);
298298

299299
dlclose(handle);
300300
return 0;

0 commit comments

Comments
 (0)