Skip to content

Commit b18b544

Browse files
RossBruntonrlavaee
authored andcommitted
[Offload] Make CUDA Driver Version a string (llvm#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.
1 parent bb8c34f commit b18b544

File tree

1 file changed

+3
-1
lines changed
  • offload/plugins-nextgen/cuda/src

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -930,7 +930,9 @@ struct CUDADeviceTy : public GenericDeviceTy {
930930

931931
CUresult Res = cuDriverGetVersion(&TmpInt);
932932
if (Res == CUDA_SUCCESS)
933-
Info.add("CUDA Driver Version", TmpInt);
933+
// For consistency with other drivers, store the version as a string
934+
// rather than an integer
935+
Info.add("CUDA Driver Version", std::to_string(TmpInt));
934936

935937
Info.add("CUDA OpenMP Device Number", DeviceId);
936938

0 commit comments

Comments
 (0)