Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 7 additions & 11 deletions sycl/plugins/cuda/pi_cuda.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1948,18 +1948,14 @@ pi_result cuda_piDeviceGetInfo(pi_device device, pi_device_info param_name,
}

case PI_DEVICE_INFO_UUID: {
int driver_version = 0;
cuDriverGetVersion(&driver_version);
int major = driver_version / 1000;
int minor = driver_version % 1000 / 10;
CUuuid uuid;
if ((major > 11) || (major == 11 && minor >= 4)) {
sycl::detail::pi::assertion(cuDeviceGetUuid_v2(&uuid, device->get()) ==
CUDA_SUCCESS);
} else {
sycl::detail::pi::assertion(cuDeviceGetUuid(&uuid, device->get()) ==
CUDA_SUCCESS);
}
#if (CUDA_VERSION >= 11040)
sycl::detail::pi::assertion(cuDeviceGetUuid_v2(&uuid, device->get()) ==
CUDA_SUCCESS);
#else
sycl::detail::pi::assertion(cuDeviceGetUuid(&uuid, device->get()) ==
CUDA_SUCCESS);
#endif
std::array<unsigned char, 16> name;
std::copy(uuid.bytes, uuid.bytes + 16, name.begin());
return getInfoArray(16, param_value_size, param_value, param_value_size_ret,
Expand Down