@@ -1418,6 +1418,63 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
14181418 return ReturnValue (true );
14191419 case UR_DEVICE_INFO_KERNEL_LAUNCH_CAPABILITIES:
14201420 return ReturnValue (0 );
1421+ case UR_DEVICE_INFO_LUID: {
1422+ // LUID is only available on Windows.
1423+ // Intel extension for device LUID. This returns the LUID as
1424+ // std::array<std::byte, 8>. For details about this extension,
1425+ // see sycl/doc/extensions/supported/sycl_ext_intel_device_info.md.
1426+
1427+ // Use the cl_khr_device_uuid extension, if available.
1428+ bool isKhrDeviceLuidSupported = false ;
1429+ if (hDevice->checkDeviceExtensions ({" cl_khr_device_uuid" },
1430+ isKhrDeviceLuidSupported) !=
1431+ UR_RESULT_SUCCESS ||
1432+ !isKhrDeviceLuidSupported) {
1433+ return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
1434+ }
1435+
1436+ cl_bool isLuidValid;
1437+ CL_RETURN_ON_FAILURE (
1438+ clGetDeviceInfo (hDevice->CLDevice , CL_DEVICE_LUID_VALID_KHR,
1439+ sizeof (cl_bool), &isLuidValid, nullptr ));
1440+
1441+ if (!isLuidValid) {
1442+ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
1443+ }
1444+
1445+ static_assert (CL_LUID_SIZE_KHR == 8 );
1446+ std::array<unsigned char , CL_LUID_SIZE_KHR> UUID{};
1447+ CL_RETURN_ON_FAILURE (clGetDeviceInfo (hDevice->CLDevice , CL_DEVICE_LUID_KHR,
1448+ UUID.size (), UUID.data (), nullptr ));
1449+ return ReturnValue (UUID);
1450+ }
1451+ case UR_DEVICE_INFO_NODE_MASK: {
1452+ // Device node mask is only available on Windows.
1453+ // Intel extension for device node mask. This returns the node mask as
1454+ // uint32_t. For details about this extension,
1455+ // see sycl/doc/extensions/supported/sycl_ext_intel_device_info.md.
1456+
1457+ // Use the cl_khr_device_uuid extension, if available.
1458+ bool isKhrDeviceLuidSupported = false ;
1459+ if (hDevice->checkDeviceExtensions ({" cl_khr_device_uuid" },
1460+ isKhrDeviceLuidSupported) !=
1461+ UR_RESULT_SUCCESS ||
1462+ !isKhrDeviceLuidSupported) {
1463+ return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
1464+ }
1465+
1466+ cl_int *nodeMask = nullptr ;
1467+
1468+ CL_RETURN_ON_FAILURE (clGetDeviceInfo (hDevice->CLDevice ,
1469+ CL_DEVICE_NODE_MASK_KHR,
1470+ sizeof (cl_int), nodeMask, nullptr ));
1471+
1472+ if (nodeMask == nullptr ) {
1473+ return UR_RESULT_ERROR_UNSUPPORTED_FEATURE;
1474+ }
1475+
1476+ return ReturnValue (*nodeMask);
1477+ }
14211478 // TODO: We can't query to check if these are supported, they will need to be
14221479 // manually updated if support is ever implemented.
14231480 case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:
0 commit comments