Add ze_eu_count_t to get total number of EUs

Related-To: LOCI-2667

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2022-01-06 02:23:53 +00:00
committed by Compute-Runtime-Automation
parent 8ec74558ea
commit 635c02e1ff
3 changed files with 57 additions and 2 deletions

View File

@@ -552,6 +552,20 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
std::string name = getNEODevice()->getDeviceInfo().name;
memcpy_s(pDeviceProperties->name, name.length(), name.c_str(), name.length());
if (pDeviceProperties->pNext) {
ze_base_desc_t *extendedDesc = reinterpret_cast<ze_base_desc_t *>(pDeviceProperties->pNext);
if (extendedDesc->stype == ZE_STRUCTURE_TYPE_EU_COUNT_EXT) {
ze_eu_count_ext_t *ze_eu_count_desc = reinterpret_cast<ze_eu_count_ext_t *>(extendedDesc);
uint32_t numTotalEUs = hardwareInfo.gtSystemInfo.MaxEuPerSubSlice * hardwareInfo.gtSystemInfo.SubSliceCount * hardwareInfo.gtSystemInfo.SliceCount;
if (isImplicitScalingCapable()) {
numTotalEUs *= neoDevice->getNumGenericSubDevices();
}
ze_eu_count_desc->numTotalEUs = numTotalEUs;
}
}
return ZE_RESULT_SUCCESS;
}