mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-24 12:23:05 +08:00
fix: generate SPIR-V for first device with -spv_only and multiple devices
If the family is provided as a device with the "-spv_only" flag, then the SPIR-V file will be generated for the first device in the family. Related-to: NEO-11550 Signed-off-by: Alicja Lukaszewicz <alicja.lukaszewicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
c5f0d3152d
commit
3db2bfc235
@@ -31,6 +31,11 @@
|
||||
#include <set>
|
||||
|
||||
namespace NEO {
|
||||
|
||||
bool isSpvOnly(const std::vector<std::string> &args) {
|
||||
return std::find(args.begin(), args.end(), "-spv_only") != args.end();
|
||||
}
|
||||
|
||||
bool requestedFatBinary(ConstStringRef deviceArg, OclocArgHelper *helper) {
|
||||
auto deviceName = deviceArg.str();
|
||||
ProductConfigHelper::adjustDeviceName(deviceName);
|
||||
@@ -266,6 +271,17 @@ std::vector<ConstStringRef> getTargetProductsForFatbinary(ConstStringRef deviceA
|
||||
return retVal;
|
||||
}
|
||||
|
||||
int getDeviceArgValueIdx(const std::vector<std::string> &args) {
|
||||
for (size_t argIndex = 0; argIndex < args.size(); ++argIndex) {
|
||||
const auto &currArg = args[argIndex];
|
||||
const bool hasMoreArgs = (argIndex + 1 < args.size());
|
||||
if ((ConstStringRef("-device") == currArg) && hasMoreArgs) {
|
||||
return static_cast<int>(argIndex + 1);
|
||||
}
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int buildFatBinaryForTarget(int retVal, const std::vector<std::string> &argsCopy, std::string pointerSize, Ar::ArEncoder &fatbinary,
|
||||
OfflineCompiler *pCompiler, OclocArgHelper *argHelper, const std::string &product) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user