File tree 3 files changed +19
-0
lines changed
source/adapters/level_zero
3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -873,6 +873,18 @@ ur_result_t urDeviceGetInfo(
873
873
return ReturnValue (int32_t (ZeDeviceNumIndices));
874
874
} break ;
875
875
case UR_DEVICE_INFO_GPU_EU_COUNT: {
876
+ if (Device->Platform ->ZeDriverEuCountExtensionFound ) {
877
+ ze_device_properties_t DeviceProp = {};
878
+ DeviceProp.stype = ZE_STRUCTURE_TYPE_DEVICE_PROPERTIES;
879
+ ze_eu_count_ext_t EuCountDesc = {};
880
+ EuCountDesc.stype = ZE_STRUCTURE_TYPE_EU_COUNT_EXT;
881
+ DeviceProp.pNext = (void *)&EuCountDesc;
882
+ ZE2UR_CALL (zeDeviceGetProperties, (ZeDevice, &DeviceProp));
883
+ if (EuCountDesc.numTotalEUs > 0 ) {
884
+ return ReturnValue (uint32_t {EuCountDesc.numTotalEUs });
885
+ }
886
+ }
887
+
876
888
uint32_t count = Device->ZeDeviceProperties ->numEUsPerSubslice *
877
889
Device->ZeDeviceProperties ->numSubslicesPerSlice *
878
890
Device->ZeDeviceProperties ->numSlices ;
Original file line number Diff line number Diff line change @@ -270,6 +270,12 @@ ur_result_t ur_platform_handle_t_::initialize() {
270
270
ZeIntelExternalSemaphoreExtensionSupported = true ;
271
271
}
272
272
}
273
+ if (strncmp (extension.name , ZE_EU_COUNT_EXT_NAME,
274
+ strlen (ZE_EU_COUNT_EXT_NAME) + 1 ) == 0 ) {
275
+ if (extension.version == ZE_EU_COUNT_EXT_VERSION_1_0) {
276
+ ZeDriverEuCountExtensionFound = true ;
277
+ }
278
+ }
273
279
zeDriverExtensionMap[extension.name ] = extension.version ;
274
280
}
275
281
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ struct ur_platform_handle_t_ : public _ur_platform {
61
61
bool ZeDriverModuleProgramExtensionFound{false };
62
62
bool ZeDriverEventPoolCountingEventsExtensionFound{false };
63
63
bool zeDriverImmediateCommandListAppendFound{false };
64
+ bool ZeDriverEuCountExtensionFound{false };
64
65
65
66
// Cache UR devices for reuse
66
67
std::vector<std::unique_ptr<ur_device_handle_t_>> URDevicesCache;
You can’t perform that action at this time.
0 commit comments