Skip to content

Commit 30a3437

Browse files
committed
capitalize UUID; use StringRef::ends_with
1 parent 04ba6a5 commit 30a3437

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

offload/plugins-nextgen/amdgpu/src/rtl.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2091,11 +2091,11 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
20912091
//
20922092
// Agents that do not support UUID will return the string "GPU-XX" or
20932093
// "CPU-XX" or "DSP-XX" depending on their device type.
2094-
char Uuid[24] = {0};
2095-
if (auto Err = getDeviceAttr(HSA_AMD_AGENT_INFO_UUID, Uuid))
2094+
char UUID[24] = {0};
2095+
if (auto Err = getDeviceAttr(HSA_AMD_AGENT_INFO_UUID, UUID))
20962096
return Err;
2097-
if (strcmp(Uuid + 3, "-XX") != 0)
2098-
setDeviceUidFromVendorUid(Uuid);
2097+
if (!StringRef(UUID).ends_with("-XX"))
2098+
setDeviceUidFromVendorUid(UUID);
20992099

21002100
// Get the wavefront size.
21012101
uint32_t WavefrontSize = 0;

offload/plugins-nextgen/cuda/src/rtl.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -294,11 +294,11 @@ struct CUDADeviceTy : public GenericDeviceTy {
294294
if (auto Err = Plugin::check(Res, "error in cuDeviceGet: %s"))
295295
return Err;
296296

297-
CUuuid Uuid = {0};
298-
Res = cuDeviceGetUuid(&Uuid, Device);
297+
CUuuid UUID = {0};
298+
Res = cuDeviceGetUuid(&UUID, Device);
299299
if (auto Err = Plugin::check(Res, "error in cuDeviceGetUuid: %s"))
300300
return Err;
301-
setDeviceUidFromVendorUid(toHex(Uuid.bytes, true));
301+
setDeviceUidFromVendorUid(toHex(UUID.bytes, true));
302302

303303
// Query the current flags of the primary context and set its flags if
304304
// it is inactive.

0 commit comments

Comments
 (0)