Merge 15d0330cb9
into 556c0b64c6
This commit is contained in:
commit
bdcf28f56a
|
@ -377,13 +377,21 @@ void Program::updateNonUniformFlag() {
|
|||
if (pos == std::string::npos) {
|
||||
programOptionVersion = 12u; // Default is 1.2
|
||||
} else {
|
||||
std::stringstream ss{options.c_str() + pos + clStdOptionName.size()};
|
||||
uint32_t majorV = 0u, minorV = 0u;
|
||||
char dot = 0u;
|
||||
ss >> majorV;
|
||||
ss >> dot;
|
||||
ss >> minorV;
|
||||
programOptionVersion = majorV * 10u + minorV;
|
||||
const std::string_view opt(options.c_str() + pos + clStdOptionName.size());
|
||||
|
||||
if (opt.find("CLC++") == 0 || opt.find("CLC++1.0") == 0) {
|
||||
programOptionVersion = 20;
|
||||
} else if (opt.find("CLC++2021") == 0) {
|
||||
programOptionVersion = 30;
|
||||
} else {
|
||||
std::stringstream ss{options.c_str() + pos + clStdOptionName.size()};
|
||||
uint32_t majorV = 0u, minorV = 0u;
|
||||
char dot = 0u;
|
||||
ss >> majorV;
|
||||
ss >> dot;
|
||||
ss >> minorV;
|
||||
programOptionVersion = majorV * 10u + minorV;
|
||||
}
|
||||
}
|
||||
|
||||
if (programOptionVersion >= 20u && (false == CompilerOptions::contains(options, CompilerOptions::uniformWorkgroupSize))) {
|
||||
|
|
|
@ -25,9 +25,19 @@ uint32_t getMajorVersion(const std::string &compileOptions) {
|
|||
if (clStdValuePosition == std::string::npos) {
|
||||
return 0;
|
||||
}
|
||||
std::stringstream ss{compileOptions.c_str() + clStdValuePosition + clStdOptionName.size()};
|
||||
|
||||
uint32_t majorVersion;
|
||||
ss >> majorVersion;
|
||||
const std::string_view opt(compileOptions.c_str() + clStdValuePosition + clStdOptionName.size());
|
||||
|
||||
if (opt.find("CLC++") == 0 || opt.find("CLC++1.0") == 0) {
|
||||
majorVersion = 2;
|
||||
} else if (opt.find("CLC++2021") == 0) {
|
||||
majorVersion = 3;
|
||||
} else {
|
||||
std::stringstream ss{compileOptions.c_str() + clStdValuePosition + clStdOptionName.size()};
|
||||
ss >> majorVersion;
|
||||
}
|
||||
|
||||
return majorVersion;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue