summaryrefslogtreecommitdiffstats
path: root/Source/cmStandardLevelResolver.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'Source/cmStandardLevelResolver.cxx')
-rw-r--r--Source/cmStandardLevelResolver.cxx18
1 files changed, 15 insertions, 3 deletions
diff --git a/Source/cmStandardLevelResolver.cxx b/Source/cmStandardLevelResolver.cxx
index b198a00..73d0fed 100644
--- a/Source/cmStandardLevelResolver.cxx
+++ b/Source/cmStandardLevelResolver.cxx
@@ -36,6 +36,9 @@ const char* const CXX_FEATURES[] = { nullptr FOR_EACH_CXX_FEATURE(
const char* const CUDA_FEATURES[] = { nullptr FOR_EACH_CUDA_FEATURE(
FEATURE_STRING) };
+
+const char* const HIP_FEATURES[] = { nullptr FOR_EACH_HIP_FEATURE(
+ FEATURE_STRING) };
#undef FEATURE_STRING
struct StandardNeeded
@@ -306,8 +309,7 @@ struct StanardLevelComputer
};
std::unordered_map<std::string, StanardLevelComputer> StandardComputerMapping =
- {
- { "C",
+ { { "C",
StanardLevelComputer{
"C", std::vector<int>{ 90, 99, 11, 17, 23 },
std::vector<std::string>{ "90", "99", "11", "17", "23" } } },
@@ -326,7 +328,10 @@ std::unordered_map<std::string, StanardLevelComputer> StandardComputerMapping =
StanardLevelComputer{
"OBJCXX", std::vector<int>{ 98, 11, 14, 17, 20, 23 },
std::vector<std::string>{ "98", "11", "14", "17", "20", "23" } } },
- };
+ { "HIP",
+ StanardLevelComputer{
+ "HIP", std::vector<int>{ 98, 11, 14, 17, 20, 23 },
+ std::vector<std::string>{ "98", "11", "14", "17", "20", "23" } } } };
}
std::string cmStandardLevelResolver::GetCompileOptionDef(
@@ -434,6 +439,13 @@ bool cmStandardLevelResolver::CompileFeatureKnown(
lang = "CUDA";
return true;
}
+ bool isHIPFeature =
+ std::find_if(cm::cbegin(HIP_FEATURES) + 1, cm::cend(HIP_FEATURES),
+ cmStrCmp(feature)) != cm::cend(HIP_FEATURES);
+ if (isHIPFeature) {
+ lang = "HIP";
+ return true;
+ }
std::ostringstream e;
if (error) {
e << "specified";