mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-20 00:24:58 +08:00
Set device ids for PRODUCT_CONFIG
Ocloc must set the default device id if the user selects <major>.<minor>.<revision> pattern. Signed-off-by: Daria Hinz <daria.hinz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7a2c5e28c1
commit
0c6863766a
@@ -57,11 +57,13 @@ OclocArgHelper::OclocArgHelper(const uint32_t numSources, const uint8_t **dataSo
|
||||
#undef NAMEDDEVICE
|
||||
{0u, std::string("")}}),
|
||||
deviceMap({
|
||||
#define DEVICE_CONFIG_REVISION(product, productConfig, revision_id) {product, &NEO::productConfig::hwInfo, NEO::productConfig::setupHardwareInfo, revision_id},
|
||||
#define DEVICE_CONFIG(product, productConfig) {product, &NEO::productConfig::hwInfo, NEO::productConfig::setupHardwareInfo, NEO::productConfig::hwInfo.platform.usRevId},
|
||||
#define DEVICE_CONFIG_IDS_AND_REVISION(product, productConfig, deviceIds, revision_id) {product, &NEO::productConfig::hwInfo, &NEO::deviceIds, NEO::productConfig::setupHardwareInfo, revision_id},
|
||||
#define DEVICE_CONFIG_IDS(product, productConfig, deviceIds) {product, &NEO::productConfig::hwInfo, &NEO::deviceIds, NEO::productConfig::setupHardwareInfo, NEO::productConfig::hwInfo.platform.usRevId},
|
||||
#define DEVICE_CONFIG(product, productConfig) {product, &NEO::productConfig::hwInfo, nullptr, NEO::productConfig::setupHardwareInfo, NEO::productConfig::hwInfo.platform.usRevId},
|
||||
#include "product_config.inl"
|
||||
#undef DEVICE_CONFIG
|
||||
#undef DEVICE_CONFIG_REVISION
|
||||
#undef DEVICE_CONFIG_IDS
|
||||
#undef DEVICE_CONFIG_IDS_AND_REVISION
|
||||
}) {
|
||||
for (uint32_t i = 0; i < numSources; ++i) {
|
||||
inputs.push_back(Source(dataSources[i], static_cast<size_t>(lenSources[i]), nameSources[i]));
|
||||
@@ -165,12 +167,16 @@ void OclocArgHelper::setDeviceInfoForFatbinaryTarget(const DeviceMapping &device
|
||||
deviceForFatbinary.hwInfo = device.hwInfo;
|
||||
deviceForFatbinary.setupHardwareInfo = device.setupHardwareInfo;
|
||||
deviceForFatbinary.revId = device.revId;
|
||||
deviceForFatbinary.deviceIds = device.deviceIds;
|
||||
}
|
||||
|
||||
void OclocArgHelper::setHwInfoForFatbinaryTarget(NEO::HardwareInfo &hwInfo) {
|
||||
hwInfo = *deviceForFatbinary.hwInfo;
|
||||
deviceForFatbinary.setupHardwareInfo(&hwInfo, true);
|
||||
hwInfo.platform.usRevId = deviceForFatbinary.revId;
|
||||
if (deviceForFatbinary.deviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceForFatbinary.deviceIds->front();
|
||||
}
|
||||
}
|
||||
|
||||
bool OclocArgHelper::getHwInfoForProductConfig(uint32_t config, NEO::HardwareInfo &hwInfo) {
|
||||
@@ -183,6 +189,9 @@ bool OclocArgHelper::getHwInfoForProductConfig(uint32_t config, NEO::HardwareInf
|
||||
hwInfo = *deviceConfig.hwInfo;
|
||||
deviceConfig.setupHardwareInfo(&hwInfo, true);
|
||||
hwInfo.platform.usRevId = deviceConfig.revId;
|
||||
if (deviceConfig.deviceIds) {
|
||||
hwInfo.platform.usDeviceID = deviceConfig.deviceIds->front();
|
||||
}
|
||||
retVal = true;
|
||||
return retVal;
|
||||
}
|
||||
@@ -227,7 +236,7 @@ std::string OclocArgHelper::returnProductNameForDevice(unsigned short deviceId)
|
||||
return res;
|
||||
}
|
||||
|
||||
std::vector<DeviceMapping> OclocArgHelper::getAllSupportedDeviceConfigs() {
|
||||
std::vector<DeviceMapping> &OclocArgHelper::getAllSupportedDeviceConfigs() {
|
||||
return deviceMap;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user