Skip to content

Commit d9c446b

Browse files
authored
Merge pull request #2447 from nrspruit/fix_deviceinfo_vector_width
[L0] Fix Device Info Reporting for vector width to match spec
2 parents 4c5cc83 + 0185baf commit d9c446b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

source/adapters/level_zero/device.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,9 +654,15 @@ ur_result_t urDeviceGetInfo(
654654
return ReturnValue(Device->ZeDeviceProperties->physicalEUSimdWidth / 4);
655655
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_DOUBLE:
656656
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_DOUBLE:
657+
// Must return 0 for *vector_width_double* if the device does not have fp64.
658+
if (!(Device->ZeDeviceModuleProperties->flags & ZE_DEVICE_MODULE_FLAG_FP64))
659+
return ReturnValue(uint32_t{0});
657660
return ReturnValue(Device->ZeDeviceProperties->physicalEUSimdWidth / 8);
658661
case UR_DEVICE_INFO_NATIVE_VECTOR_WIDTH_HALF:
659662
case UR_DEVICE_INFO_PREFERRED_VECTOR_WIDTH_HALF:
663+
// Must return 0 for *vector_width_half* if the device does not have fp16.
664+
if (!(Device->ZeDeviceModuleProperties->flags & ZE_DEVICE_MODULE_FLAG_FP16))
665+
return ReturnValue(uint32_t{0});
660666
return ReturnValue(Device->ZeDeviceProperties->physicalEUSimdWidth / 2);
661667
case UR_DEVICE_INFO_MAX_NUM_SUB_GROUPS: {
662668
// Max_num_sub_Groups = maxTotalGroupSize/min(set of subGroupSizes);

0 commit comments

Comments
 (0)