mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
Use device ID from ProductConfigHelper
This commit switches the device ID logic from the deprecated to the new one, so that if the user passes a hex value to the -device parameter, ocloc will use the new implementation in the product config helper. Signed-off-by: Daria Hinz <daria.hinz@intel.com> Related-To: NEO-7487
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a30cc94708
commit
60a8bcb3d7
@@ -58,13 +58,7 @@ OclocArgHelper::OclocArgHelper(const uint32_t numSources, const uint8_t **dataSo
|
||||
uint64_t **lenOutputs, char ***nameOutputs)
|
||||
: numOutputs(numOutputs), nameOutputs(nameOutputs),
|
||||
dataOutputs(dataOutputs), lenOutputs(lenOutputs), hasOutput(numOutputs != nullptr),
|
||||
messagePrinter(hasOutput), deviceProductTable({
|
||||
#define NAMEDDEVICE(devId, product, ignored_devName) {devId, NEO::hardwarePrefix[NEO::product::hwInfo.platform.eProductFamily]},
|
||||
#define DEVICE(devId, product) {devId, NEO::hardwarePrefix[NEO::product::hwInfo.platform.eProductFamily]},
|
||||
#include "devices.inl"
|
||||
#undef DEVICE
|
||||
#undef NAMEDDEVICE
|
||||
{0u, std::string("")}}) {
|
||||
messagePrinter(hasOutput) {
|
||||
for (uint32_t i = 0; i < numSources; ++i) {
|
||||
inputs.push_back(Source(dataSources[i], static_cast<size_t>(lenSources[i]), nameSources[i]));
|
||||
}
|
||||
@@ -199,25 +193,4 @@ void OclocArgHelper::saveOutput(const std::string &filename, const std::ostream
|
||||
std::ofstream file(filename);
|
||||
file << ss.str();
|
||||
}
|
||||
}
|
||||
|
||||
bool OclocArgHelper::setAcronymForDeviceId(std::string &device) {
|
||||
auto product = returnProductNameForDevice(std::stoi(device, 0, 16));
|
||||
if (!product.empty()) {
|
||||
printf("Auto-detected target based on %s device id: %s\n", device.c_str(), product.c_str());
|
||||
|
||||
} else {
|
||||
printf("Could not determine target based on device id: %s\n", device.c_str());
|
||||
return false;
|
||||
}
|
||||
device = std::move(product);
|
||||
return true;
|
||||
}
|
||||
std::string OclocArgHelper::returnProductNameForDevice(unsigned short deviceId) {
|
||||
for (int i = 0; deviceProductTable[i].deviceId != 0; i++) {
|
||||
if (deviceProductTable[i].deviceId == deviceId) {
|
||||
return deviceProductTable[i].product;
|
||||
}
|
||||
}
|
||||
return "";
|
||||
}
|
||||
Reference in New Issue
Block a user