File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
source/adapters/level_zero Expand file tree Collapse file tree 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(
873873 return ReturnValue (int32_t (ZeDeviceNumIndices));
874874 } break ;
875875 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+
876888 uint32_t count = Device->ZeDeviceProperties ->numEUsPerSubslice *
877889 Device->ZeDeviceProperties ->numSubslicesPerSlice *
878890 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() {
270270 ZeIntelExternalSemaphoreExtensionSupported = true ;
271271 }
272272 }
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+ }
273279 zeDriverExtensionMap[extension.name ] = extension.version ;
274280 }
275281
Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ struct ur_platform_handle_t_ : public _ur_platform {
6161 bool ZeDriverModuleProgramExtensionFound{false };
6262 bool ZeDriverEventPoolCountingEventsExtensionFound{false };
6363 bool zeDriverImmediateCommandListAppendFound{false };
64+ bool ZeDriverEuCountExtensionFound{false };
6465
6566 // Cache UR devices for reuse
6667 std::vector<std::unique_ptr<ur_device_handle_t_>> URDevicesCache;
You can’t perform that action at this time.
0 commit comments