@@ -887,8 +887,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
887
887
case UR_DEVICE_INFO_AVAILABLE:
888
888
case UR_DEVICE_INFO_COMPILER_AVAILABLE:
889
889
case UR_DEVICE_INFO_LINKER_AVAILABLE:
890
- case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC:
891
- case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: {
890
+ case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
892
891
/* CL type: cl_bool
893
892
* UR type: ur_bool_t */
894
893
@@ -900,6 +899,27 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
900
899
/* cl_bool is uint32_t and ur_bool_t is bool */
901
900
return ReturnValue (static_cast <ur_bool_t >(CLValue));
902
901
}
902
+ case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: {
903
+ /* CL type: cl_bool
904
+ * UR type: ur_bool_t */
905
+
906
+ oclv::OpenCLVersion DevVer;
907
+ CL_RETURN_ON_FAILURE (cl_adapter::getDeviceVersion (
908
+ cl_adapter::cast<cl_device_id>(hDevice), DevVer));
909
+ /* Independent forward progress query is only supported as of OpenCL 2.1
910
+ * if version is older we return a default false. */
911
+ if (DevVer >= oclv::V2_1) {
912
+ cl_bool CLValue;
913
+ CL_RETURN_ON_FAILURE (
914
+ clGetDeviceInfo (cl_adapter::cast<cl_device_id>(hDevice), CLPropName,
915
+ sizeof (cl_bool), &CLValue, nullptr ));
916
+
917
+ /* cl_bool is uint32_t and ur_bool_t is bool */
918
+ return ReturnValue (static_cast <ur_bool_t >(CLValue));
919
+ } else {
920
+ return ReturnValue (false );
921
+ }
922
+ }
903
923
case UR_DEVICE_INFO_VENDOR_ID:
904
924
case UR_DEVICE_INFO_MAX_COMPUTE_UNITS:
905
925
case UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS:
0 commit comments