@@ -825,12 +825,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
825825 case UR_DEVICE_INFO_GLOBAL_MEM_CACHE_TYPE:
826826 case UR_DEVICE_INFO_LOCAL_MEM_TYPE:
827827 case UR_DEVICE_INFO_EXECUTION_CAPABILITIES:
828- case UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN:
829- case UR_DEVICE_INFO_USM_HOST_SUPPORT:
830- case UR_DEVICE_INFO_USM_DEVICE_SUPPORT:
831- case UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT:
832- case UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT:
833- case UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT: {
828+ case UR_DEVICE_INFO_PARTITION_AFFINITY_DOMAIN: {
834829 /* CL type: cl_bitfield / enum
835830 * UR type: ur_flags_t (uint32_t) */
836831
@@ -844,6 +839,27 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
844839 * types are uint32_t */
845840 return ReturnValue (static_cast <uint32_t >(CLValue));
846841 }
842+ case UR_DEVICE_INFO_USM_HOST_SUPPORT:
843+ case UR_DEVICE_INFO_USM_DEVICE_SUPPORT:
844+ case UR_DEVICE_INFO_USM_SINGLE_SHARED_SUPPORT:
845+ case UR_DEVICE_INFO_USM_CROSS_SHARED_SUPPORT:
846+ case UR_DEVICE_INFO_USM_SYSTEM_SHARED_SUPPORT: {
847+ /* CL type: cl_bitfield / enum
848+ * UR type: ur_flags_t (uint32_t) */
849+ bool Supported = false ;
850+ UR_RETURN_ON_FAILURE (cl_adapter::checkDeviceExtensions (
851+ cl_adapter::cast<cl_device_id>(hDevice),
852+ {" cl_intel_unified_shared_memory" }, Supported));
853+ if (Supported) {
854+ cl_bitfield CLValue = 0 ;
855+ CL_RETURN_ON_FAILURE (
856+ clGetDeviceInfo (cl_adapter::cast<cl_device_id>(hDevice), CLPropName,
857+ sizeof (cl_bitfield), &CLValue, nullptr ));
858+ return ReturnValue (static_cast <uint32_t >(CLValue));
859+ } else {
860+ return ReturnValue (0 );
861+ }
862+ }
847863 case UR_DEVICE_INFO_IMAGE_SUPPORTED:
848864 case UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT:
849865 case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY:
@@ -918,8 +934,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
918934 case UR_DEVICE_INFO_VERSION:
919935 case UR_EXT_DEVICE_INFO_OPENCL_C_VERSION:
920936 case UR_DEVICE_INFO_BUILT_IN_KERNELS:
921- case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES:
922- case UR_DEVICE_INFO_IP_VERSION: {
937+ case UR_DEVICE_INFO_MAX_WORK_ITEM_SIZES: {
923938 /* We can just use the OpenCL outputs because the sizes of OpenCL types
924939 * are the same as UR.
925940 * | CL | UR | Size |
@@ -937,7 +952,33 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
937952
938953 return UR_RESULT_SUCCESS;
939954 }
955+ case UR_DEVICE_INFO_IP_VERSION: {
956+ bool Supported;
957+ UR_RETURN_ON_FAILURE (cl_adapter::checkDeviceExtensions (
958+ cl_adapter::cast<cl_device_id>(hDevice),
959+ {" cl_intel_device_attribute_query" }, Supported));
960+ if (!Supported) {
961+ return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
962+ }
963+ CL_RETURN_ON_FAILURE (
964+ clGetDeviceInfo (cl_adapter::cast<cl_device_id>(hDevice), CLPropName,
965+ propSize, pPropValue, pPropSizeRet));
966+
967+ return UR_RESULT_SUCCESS;
968+ }
969+
940970 case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL: {
971+ bool isExtensionSupported;
972+ if (cl_adapter::checkDeviceExtensions (
973+ cl_adapter::cast<cl_device_id>(hDevice),
974+ {" cl_intel_required_subgroup_size" },
975+ isExtensionSupported) != UR_RESULT_SUCCESS ||
976+ !isExtensionSupported) {
977+ std::vector<uint32_t > aThreadIsItsOwnSubGroup ({1 });
978+ return ReturnValue (aThreadIsItsOwnSubGroup.data (),
979+ aThreadIsItsOwnSubGroup.size ());
980+ }
981+
941982 // Have to convert size_t to uint32_t
942983 size_t SubGroupSizesSize = 0 ;
943984 CL_RETURN_ON_FAILURE (
0 commit comments