Ocloc: Add -s to options string for non-spirv input with -g option passed

Automatically add "-s" (source path) option if -g flag is present.
This applies only to non-spirv input.
- Due to conflict, do not automatically append source path when
CMC compiler is used.

Related-To: NEO-7285
Signed-off-by: Kacper Nowak kacper.nowak@intel.com
This commit is contained in:
Kacper Nowak
2022-09-09 18:44:06 +00:00
committed by Compute-Runtime-Automation
parent ccdb5aaa2a
commit 963930925a
4 changed files with 131 additions and 0 deletions

View File

@@ -32,6 +32,11 @@ bool contains(const std::string &options, ConstStringRef optionToFind) {
return contains(options.c_str(), optionToFind);
}
std::string wrapInQuotes(const std::string &stringToWrap) {
std::string quoteEscape{"\""};
return std::string{quoteEscape + stringToWrap + quoteEscape};
}
TokenizedString tokenize(ConstStringRef src, char sperator) {
TokenizedString ret;
const char *it = src.begin();

View File

@@ -29,6 +29,7 @@ constexpr ConstStringRef fastRelaxedMath = "-cl-fast-relaxed-math";
constexpr ConstStringRef preserveVec3Type = "-fpreserve-vec3-type";
constexpr ConstStringRef createLibrary = "-create-library";
constexpr ConstStringRef generateDebugInfo = "-g";
constexpr ConstStringRef generateSourcePath = "-s";
constexpr ConstStringRef bindlessMode = "-cl-intel-use-bindless-mode -cl-intel-use-bindless-advanced-mode";
constexpr ConstStringRef uniformWorkgroupSize = "-cl-uniform-work-group-size";
constexpr ConstStringRef forceEmuInt32DivRem = "-cl-intel-force-emu-int32divrem";
@@ -42,6 +43,7 @@ constexpr ConstStringRef noRecompiledFromIr = "-Wno-recompiled-from-ir";
constexpr ConstStringRef defaultGrf = "-cl-intel-128-GRF-per-thread";
constexpr ConstStringRef largeGrf = "-cl-intel-256-GRF-per-thread";
constexpr ConstStringRef numThreadsPerEu = "-cl-intel-reqd-eu-thread-count";
constexpr ConstStringRef usesCMCCompiler = "cmc";
constexpr size_t nullterminateSize = 1U;
constexpr size_t spaceSeparatorSize = 1U;
@@ -177,6 +179,7 @@ bool contains(const char *options, ConstStringRef optionToFind);
bool contains(const std::string &options, ConstStringRef optionToFind);
std::string wrapInQuotes(const std::string &stringToWrap);
using TokenizedString = StackVec<ConstStringRef, 32>;
TokenizedString tokenize(ConstStringRef src, char sperator = ' ');