Skip to content

Commit 00b7b95

Browse files
kekaczmabb-ur
authored andcommitted
Fix IL_VERSION query to include null terminator (#21600)
The UR_DEVICE_INFO_IL_VERSION query was returning PTX ISA version string using ILVersion.data() and ILVersion.size(), which did not include the null terminator. This caused test failures because the conformance test expects the returned string to be null-terminated. Changed to use ILVersion.c_str() to return a properly null-terminated string, consistent with other string properties in the same file. This fix enables the SuccessILVersion conformance test for CUDA adapter.
1 parent 186a2fa commit 00b7b95

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

source/adapters/cuda/device.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
10271027
return UR_RESULT_ERROR_INVALID_VALUE;
10281028
}
10291029

1030-
return ReturnValue(ILVersion.data(), ILVersion.size());
1030+
return ReturnValue(ILVersion.c_str());
10311031
}
10321032
case UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP: {
10331033
// Maximum number of 32-bit registers available to a thread block.

test/conformance/device/urDeviceGetInfo.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1113,7 +1113,7 @@ TEST_P(urDeviceGetInfoTest, SuccessReferenceCount) {
11131113
}
11141114

11151115
TEST_P(urDeviceGetInfoTest, SuccessILVersion) {
1116-
UUR_KNOWN_FAILURE_ON(uur::CUDA{}, uur::NativeCPU{});
1116+
UUR_KNOWN_FAILURE_ON(uur::NativeCPU{});
11171117

11181118
size_t property_size = 0;
11191119
const ur_device_info_t property_name = UR_DEVICE_INFO_IL_VERSION;

0 commit comments

Comments
 (0)