Skip to content

Commit

Permalink
SWDEV-355608 - Remove clang include path
Browse files Browse the repository at this point in the history
Clang doesn't need to be told where to find the clang headers

Change-Id: I2d1e84b31013aa6668efd2ff096f5e68f9ba9a64
  • Loading branch information
scchan committed Oct 18, 2022
1 parent d0a48e9 commit 55c9432
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 43 deletions.
46 changes: 4 additions & 42 deletions amd/hipcc/src/hipBin_amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ class HipBinAmd : public HipBinBase {
virtual string getDeviceLibPath() const;
virtual string getHipLibPath() const;
virtual string getHipCC() const;
virtual string getCompilerIncludePath();
virtual string getHipInclude() const;
virtual void initializeHipCXXFlags();
virtual void initializeHipCFlags();
Expand Down Expand Up @@ -166,9 +165,6 @@ void HipBinAmd::initializeHipLdFlags() {

void HipBinAmd::initializeHipCFlags() {
string hipCFlags;
string hipclangIncludePath;
hipclangIncludePath = getHipInclude();
hipCFlags += " -isystem \"" + hipclangIncludePath + "\"";
const OsType& os = getOSInfo();
if (os != windows) {
string hsaPath;
Expand Down Expand Up @@ -203,12 +199,6 @@ string HipBinAmd::getHipInclude() const {
void HipBinAmd::initializeHipCXXFlags() {
string hipCXXFlags;
const OsType& os = getOSInfo();
string hipClangIncludePath;
hipClangIncludePath = getCompilerIncludePath();
hipCXXFlags += " -isystem \"" + hipClangIncludePath;
fs::path hipCXXFlagsTempFs = hipCXXFlags;
hipCXXFlagsTempFs /= "..\"";
hipCXXFlags = hipCXXFlagsTempFs.string();
const EnvVariables& var = getEnvVariables();
// Allow __fp16 as function parameter and return type.
if (var.hipClangHccCompactModeEnv_.compare("1") == 0) {
Expand Down Expand Up @@ -324,28 +314,19 @@ string HipBinAmd::getCppConfig() {
string compilerVersion;
compilerVersion = getCompilerVersion();

fs::path hipPathInclude, hipClangInclude, cppConfigFs;
string hipClangVersionPath;
fs::path hipPathInclude, cppConfigFs;
const string& hipPath = getHipPath();
hipPathInclude = hipPath;
hipPathInclude /= "include";

const string& compilerPath = getCompilerPath();
hipClangInclude = compilerPath;
hipClangInclude = hipClangInclude.parent_path();
hipClangInclude /= "lib/clang/";
hipClangInclude /= compilerVersion;
string hipClangPath = hipClangInclude.string();

const OsType& osInfo = getOSInfo();
if (osInfo == windows) {
cppConfig += " -I" + hipPathInclude.string() + " -I" + hipClangPath;
cppConfig += " -I" + hipPathInclude.string();
cppConfigFs = cppConfig;
cppConfigFs /= "/";
} else {
const string& hsaPath = getHsaPath();
cppConfig += " -I" + hipPathInclude.string() +
" -I" + hipClangPath + " -I" + hsaPath;
" -I" + hsaPath;
cppConfigFs = cppConfig;
cppConfigFs /= "include";
cppConfig = cppConfigFs.string();
Expand Down Expand Up @@ -439,23 +420,6 @@ string HipBinAmd::getHipCC() const {
return hipCC;
}



string HipBinAmd::getCompilerIncludePath() {
string hipClangVersion, includePath, compilerIncludePath;
const string& hipClangPath = getCompilerPath();
hipClangVersion = getCompilerVersion();
fs::path includePathfs = hipClangPath;
includePathfs = includePathfs.parent_path();
includePathfs /= "lib/clang/";
includePathfs /= hipClangVersion;
includePathfs /= "include";
includePathfs = fs::absolute(includePathfs).string();
compilerIncludePath = includePathfs.string();
return compilerIncludePath;
}


void HipBinAmd::checkHipconfig() {
printFull();
cout << endl << "Check system installation: " << endl;
Expand Down Expand Up @@ -581,14 +545,13 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
HIPCXXFLAGS = getHipCXXFlags();
HIPLDFLAGS = getHipLdFlags();
string hipLibPath;
string hipclangIncludePath , hipIncludePath, deviceLibPath;
string hipIncludePath, deviceLibPath;
hipLibPath = getHipLibPath();
const string& roccmPath = getRoccmPath();
const string& hipPath = getHipPath();
const PlatformInfo& platformInfo = getPlatformInfo();
const string& rocclrHomePath = getRocclrHomePath();
const string& hipClangPath = getCompilerPath();
hipclangIncludePath = getCompilerIncludePath();
hipIncludePath = getHipInclude();
deviceLibPath = getDeviceLibPath();
const string& hipVersion = getHipVersion();
Expand All @@ -600,7 +563,6 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
cout << "ROCM_PATH=" << roccmPath << endl;
cout << "HIP_ROCCLR_HOME="<< rocclrHomePath << endl;
cout << "HIP_CLANG_PATH=" << hipClangPath <<endl;
cout << "HIP_CLANG_INCLUDE_PATH="<< hipclangIncludePath <<endl;
cout << "HIP_INCLUDE_PATH="<< hipIncludePath <<endl;
cout << "HIP_LIB_PATH="<< hipLibPath <<endl;
cout << "DEVICE_LIB_PATH="<< deviceLibPath <<endl;
Expand Down
1 change: 0 additions & 1 deletion amd/hipcc/src/hipBin_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ class HipBinBase {
virtual const string& getCompilerPath() const = 0;
virtual void printCompilerInfo() const = 0;
virtual string getCompilerVersion() = 0;
virtual string getCompilerIncludePath() = 0;
virtual const PlatformInfo& getPlatformInfo() const = 0;
virtual string getCppConfig() = 0;
virtual void checkHipconfig() = 0;
Expand Down

0 comments on commit 55c9432

Please sign in to comment.