mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 23:56:39 +08:00
fix: ocloc fatbinary handle -out_dir without -output
Currently if we pass `-out_dir` in ocloc fatbinary cmdline, e.g.: ./ocloc compile -file vector.cl ... -out_dir ../exampler_dir ocloc sets the name for the output file from the `-output` parameter. But as the `-output` parameter is not provided, the file name will be empty and won't be written to disk. This patch adds support for a scenario where you pass `-out_dir` without `-output`. In this case, the file will have default name - input file's base name. Related-To: NEO-10603 Signed-off-by: Fabian Zwolinski <fabian.zwolinski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b3b72d0e37
commit
e7420de011
@@ -401,13 +401,21 @@ int buildFatBinary(const std::vector<std::string> &args, OclocArgHelper *argHelp
|
||||
}
|
||||
|
||||
auto fatbinaryData = fatbinary.encode();
|
||||
std::string fatbinaryFileName = outputFileName;
|
||||
if (outputFileName.empty() && (false == inputFileName.empty())) {
|
||||
fatbinaryFileName = OfflineCompiler::getFileNameTrunk(inputFileName) + ".ar";
|
||||
}
|
||||
|
||||
std::string fatbinaryFileName = "";
|
||||
|
||||
if (false == outputDirectory.empty()) {
|
||||
fatbinaryFileName = outputDirectory + "/" + outputFileName;
|
||||
fatbinaryFileName = outputDirectory + "/";
|
||||
}
|
||||
|
||||
if (false == outputFileName.empty()) {
|
||||
fatbinaryFileName += outputFileName;
|
||||
} else {
|
||||
if (false == inputFileName.empty()) {
|
||||
fatbinaryFileName += OfflineCompiler::getFileNameTrunk(inputFileName) + ".ar";
|
||||
}
|
||||
}
|
||||
|
||||
argHelper->saveOutput(fatbinaryFileName, fatbinaryData.data(), fatbinaryData.size());
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user