[Offload] Make CUDA Driver Version a string (#146049)

AMD treats this value as a string, so for consistency require this in
NVIDIA as well. This shouldn't change the output of the
`llvm-offload-device-info` tool, but does fix an issue in liboffload
when it tries to query the version.
This commit is contained in:
Ross Brunton
2025-06-27 15:07:04 +01:00
committed by GitHub
parent dcea5f1f38
commit 102cf1b999

View File

@@ -930,7 +930,9 @@ struct CUDADeviceTy : public GenericDeviceTy {
CUresult Res = cuDriverGetVersion(&TmpInt);
if (Res == CUDA_SUCCESS)
Info.add("CUDA Driver Version", TmpInt);
// For consistency with other drivers, store the version as a string
// rather than an integer
Info.add("CUDA Driver Version", std::to_string(TmpInt));
Info.add("CUDA OpenMP Device Number", DeviceId);