@@ -188,8 +188,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
188188 }
189189 case UR_DEVICE_INFO_ATOMIC_64:
190190 return ReturnValue (
191- static_cast <uint32_t >(Device->ZeDeviceModuleProperties ->flags &
192- ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS));
191+ static_cast <ur_bool_t >(Device->ZeDeviceModuleProperties ->flags &
192+ ZE_DEVICE_MODULE_FLAG_INT64_ATOMICS));
193193 case UR_DEVICE_INFO_EXTENSIONS: {
194194 // Convention adopted from OpenCL:
195195 // "Returns a space separated list of extension names (the extension
@@ -256,11 +256,11 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
256256 // > The application must only use the module for the device, or its
257257 // > sub-devices, which was provided during creation.
258258 case UR_DEVICE_INFO_BUILD_ON_SUBDEVICE:
259- return ReturnValue (uint32_t { 0 } );
259+ return ReturnValue (static_cast < ur_bool_t >( false ) );
260260 case UR_DEVICE_INFO_COMPILER_AVAILABLE:
261- return ReturnValue (static_cast <uint32_t >(true ));
261+ return ReturnValue (static_cast <ur_bool_t >(true ));
262262 case UR_DEVICE_INFO_LINKER_AVAILABLE:
263- return ReturnValue (static_cast <uint32_t >(true ));
263+ return ReturnValue (static_cast <ur_bool_t >(true ));
264264 case UR_DEVICE_INFO_MAX_COMPUTE_UNITS: {
265265 uint32_t MaxComputeUnits =
266266 Device->ZeDeviceProperties ->numEUsPerSubslice *
@@ -323,14 +323,14 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
323323 return ReturnValue (
324324 uint64_t {Device->ZeDeviceComputeProperties ->maxSharedLocalMemory });
325325 case UR_DEVICE_INFO_IMAGE_SUPPORTED:
326- return ReturnValue (static_cast <uint32_t >(
326+ return ReturnValue (static_cast <ur_bool_t >(
327327 Device->ZeDeviceImageProperties ->maxImageDims1D > 0 ));
328328 case UR_DEVICE_INFO_HOST_UNIFIED_MEMORY:
329329 return ReturnValue (
330- static_cast <uint32_t >((Device->ZeDeviceProperties ->flags &
331- ZE_DEVICE_PROPERTY_FLAG_INTEGRATED) != 0 ));
330+ static_cast <ur_bool_t >((Device->ZeDeviceProperties ->flags &
331+ ZE_DEVICE_PROPERTY_FLAG_INTEGRATED) != 0 ));
332332 case UR_DEVICE_INFO_AVAILABLE:
333- return ReturnValue (static_cast <uint32_t >(ZeDevice ? true : false ));
333+ return ReturnValue (static_cast <ur_bool_t >(ZeDevice ? true : false ));
334334 case UR_DEVICE_INFO_VENDOR:
335335 // TODO: Level-Zero does not return vendor's name at the moment
336336 // only the ID.
@@ -411,7 +411,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
411411 case UR_EXT_DEVICE_INFO_OPENCL_C_VERSION:
412412 return ReturnValue (" " );
413413 case UR_DEVICE_INFO_PREFERRED_INTEROP_USER_SYNC:
414- return ReturnValue (static_cast <uint32_t >(true ));
414+ return ReturnValue (static_cast <ur_bool_t >(true ));
415415 case UR_DEVICE_INFO_PRINTF_BUFFER_SIZE:
416416 return ReturnValue (
417417 size_t {Device->ZeDeviceModuleProperties ->printfBufferSize });
@@ -428,10 +428,10 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
428428 return ReturnValue (ur_device_exec_capability_flag_t {
429429 UR_DEVICE_EXEC_CAPABILITY_FLAG_NATIVE_KERNEL});
430430 case UR_DEVICE_INFO_ENDIAN_LITTLE:
431- return ReturnValue (static_cast <uint32_t >(true ));
431+ return ReturnValue (static_cast <ur_bool_t >(true ));
432432 case UR_DEVICE_INFO_ERROR_CORRECTION_SUPPORT:
433- return ReturnValue (static_cast <uint32_t >(Device-> ZeDeviceProperties -> flags &
434- ZE_DEVICE_PROPERTY_FLAG_ECC));
433+ return ReturnValue (static_cast <ur_bool_t >(
434+ Device-> ZeDeviceProperties -> flags & ZE_DEVICE_PROPERTY_FLAG_ECC));
435435 case UR_DEVICE_INFO_PROFILING_TIMER_RESOLUTION:
436436 return ReturnValue (
437437 static_cast <size_t >(Device->ZeDeviceProperties ->timerResolution ));
@@ -605,7 +605,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
605605 }
606606 case UR_DEVICE_INFO_SUB_GROUP_INDEPENDENT_FORWARD_PROGRESS: {
607607 // TODO: Not supported yet. Needs to be updated after support is added.
608- return ReturnValue (static_cast <uint32_t >(false ));
608+ return ReturnValue (static_cast <ur_bool_t >(false ));
609609 }
610610 case UR_DEVICE_INFO_SUB_GROUP_SIZES_INTEL: {
611611 // ze_device_compute_properties.subGroupSizes is in uint32_t whereas the
@@ -782,9 +782,6 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
782782 return ReturnValue (uint32_t {Device->ZeDeviceProperties ->numEUsPerSubslice });
783783 case UR_DEVICE_INFO_GPU_HW_THREADS_PER_EU:
784784 return ReturnValue (uint32_t {Device->ZeDeviceProperties ->numThreadsPerEU });
785- case UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH:
786- // currently not supported in level zero runtime
787- return UR_RESULT_ERROR_INVALID_VALUE;
788785 case UR_DEVICE_INFO_BFLOAT16: {
789786 // bfloat16 math functions are not yet supported on Intel GPUs.
790787 return ReturnValue (bool {false });
@@ -836,9 +833,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
836833 return ReturnValue (capabilities);
837834 }
838835 case UR_DEVICE_INFO_MEM_CHANNEL_SUPPORT:
839- return ReturnValue (uint32_t { false } );
836+ return ReturnValue (static_cast < ur_bool_t >( false ) );
840837 case UR_DEVICE_INFO_IMAGE_SRGB:
841- return ReturnValue (uint32_t { false } );
838+ return ReturnValue (static_cast < ur_bool_t >( false ) );
842839
843840 case UR_DEVICE_INFO_QUEUE_ON_DEVICE_PROPERTIES:
844841 case UR_DEVICE_INFO_QUEUE_ON_HOST_PROPERTIES: {
@@ -850,7 +847,7 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
850847 0 )); // __read_write attribute currently undefinde in opencl
851848 }
852849 case UR_DEVICE_INFO_VIRTUAL_MEMORY_SUPPORT: {
853- return ReturnValue (static_cast <uint32_t >(true ));
850+ return ReturnValue (static_cast <ur_bool_t >(true ));
854851 }
855852
856853 case UR_DEVICE_INFO_ESIMD_SUPPORT: {
@@ -915,11 +912,18 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
915912 return ze2urResult (errc);
916913 return ReturnValue (UrRootDev);
917914 }
915+ case UR_DEVICE_INFO_KERNEL_SET_SPECIALIZATION_CONSTANTS:
916+ case UR_DEVICE_INFO_ASYNC_BARRIER:
917+ case UR_DEVICE_INFO_HOST_PIPE_READ_WRITE_SUPPORTED:
918+ return ReturnValue (static_cast <ur_bool_t >(false ));
919+ case UR_DEVICE_INFO_MAX_REGISTERS_PER_WORK_GROUP:
920+ case UR_DEVICE_INFO_MAX_MEMORY_BANDWIDTH:
921+ return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
918922
919923 default :
920- urPrint (" Unsupported ParamName in urGetDeviceInfo\n " );
924+ urPrint (" Invalid ParamName in urGetDeviceInfo\n " );
921925 urPrint (" ParamName=%d(0x%x)\n " , ParamName, ParamName);
922- return UR_RESULT_ERROR_INVALID_VALUE ;
926+ return UR_RESULT_ERROR_INVALID_ENUMERATION ;
923927 }
924928
925929 return UR_RESULT_SUCCESS;
0 commit comments