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
24 changes: 22 additions & 2 deletions source/adapters/opencl/device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -887,8 +887,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
case UR_DEVICE_INFO_AVAILABLE:
case UR_DEVICE_INFO_COMPILER_AVAILABLE:
case UR_DEVICE_INFO_LINKER_AVAILABLE:
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC:
case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: {
case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC: {
/* CL type: cl_bool
* UR type: ur_bool_t */

Expand All @@ -900,6 +899,27 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(ur_device_handle_t hDevice,
/* cl_bool is uint32_t and ur_bool_t is bool */
return ReturnValue(static_cast<ur_bool_t>(CLValue));
}
case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: {
/* CL type: cl_bool
* UR type: ur_bool_t */

oclv::OpenCLVersion DevVer;
CL_RETURN_ON_FAILURE(cl_adapter::getDeviceVersion(
cl_adapter::cast<cl_device_id>(hDevice), DevVer));
/* Independent forward progress query is only supported as of OpenCL 2.1
* if version is older we return a default false. */
if (DevVer >= oclv::V2_1) {
cl_bool CLValue;
CL_RETURN_ON_FAILURE(
clGetDeviceInfo(cl_adapter::cast<cl_device_id>(hDevice), CLPropName,
sizeof(cl_bool), &CLValue, nullptr));

/* cl_bool is uint32_t and ur_bool_t is bool */
return ReturnValue(static_cast<ur_bool_t>(CLValue));
} else {
return ReturnValue(false);
}
}
case UR_DEVICE_INFO_VENDOR_ID:
case UR_DEVICE_INFO_MAX_COMPUTE_UNITS:
case UR_DEVICE_INFO_MAX_WORK_ITEM_DIMENSIONS:
Expand Down
Loading