Add debug variable to override device name

This commit introduces debug variable to override device name reported
by CL_DEVICE_NAME property in OpenCL and ze_device_properties_t.name in
level_zero

Signed-off-by: Pawel Wilma <pawel.wilma@intel.com>
This commit is contained in:
Pawel Wilma
2022-05-19 00:48:02 +00:00
committed by Compute-Runtime-Automation
parent e7e1e64cca
commit d9858bf206
6 changed files with 47 additions and 4 deletions

View File

@@ -656,7 +656,9 @@ ze_result_t DeviceImp::getProperties(ze_device_properties_t *pDeviceProperties)
memset(pDeviceProperties->name, 0, ZE_MAX_DEVICE_NAME);
std::string name = getNEODevice()->getDeviceInfo().name;
if (driverInfo) {
if (NEO::DebugManager.flags.OverrideDeviceName.get() != "unk") {
name.assign(NEO::DebugManager.flags.OverrideDeviceName.get().c_str());
} else if (driverInfo) {
name.assign(driverInfo->getDeviceName(name).c_str());
}
memcpy_s(pDeviceProperties->name, name.length(), name.c_str(), name.length());