Skip to content

Commit 55c9432

Browse files
committed
SWDEV-355608 - Remove clang include path
Clang doesn't need to be told where to find the clang headers Change-Id: I2d1e84b31013aa6668efd2ff096f5e68f9ba9a64
1 parent d0a48e9 commit 55c9432

File tree

2 files changed

+4
-43
lines changed

2 files changed

+4
-43
lines changed

amd/hipcc/src/hipBin_amd.h

Lines changed: 4 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ class HipBinAmd : public HipBinBase {
6464
virtual string getDeviceLibPath() const;
6565
virtual string getHipLibPath() const;
6666
virtual string getHipCC() const;
67-
virtual string getCompilerIncludePath();
6867
virtual string getHipInclude() const;
6968
virtual void initializeHipCXXFlags();
7069
virtual void initializeHipCFlags();
@@ -166,9 +165,6 @@ void HipBinAmd::initializeHipLdFlags() {
166165

167166
void HipBinAmd::initializeHipCFlags() {
168167
string hipCFlags;
169-
string hipclangIncludePath;
170-
hipclangIncludePath = getHipInclude();
171-
hipCFlags += " -isystem \"" + hipclangIncludePath + "\"";
172168
const OsType& os = getOSInfo();
173169
if (os != windows) {
174170
string hsaPath;
@@ -203,12 +199,6 @@ string HipBinAmd::getHipInclude() const {
203199
void HipBinAmd::initializeHipCXXFlags() {
204200
string hipCXXFlags;
205201
const OsType& os = getOSInfo();
206-
string hipClangIncludePath;
207-
hipClangIncludePath = getCompilerIncludePath();
208-
hipCXXFlags += " -isystem \"" + hipClangIncludePath;
209-
fs::path hipCXXFlagsTempFs = hipCXXFlags;
210-
hipCXXFlagsTempFs /= "..\"";
211-
hipCXXFlags = hipCXXFlagsTempFs.string();
212202
const EnvVariables& var = getEnvVariables();
213203
// Allow __fp16 as function parameter and return type.
214204
if (var.hipClangHccCompactModeEnv_.compare("1") == 0) {
@@ -324,28 +314,19 @@ string HipBinAmd::getCppConfig() {
324314
string compilerVersion;
325315
compilerVersion = getCompilerVersion();
326316

327-
fs::path hipPathInclude, hipClangInclude, cppConfigFs;
328-
string hipClangVersionPath;
317+
fs::path hipPathInclude, cppConfigFs;
329318
const string& hipPath = getHipPath();
330319
hipPathInclude = hipPath;
331320
hipPathInclude /= "include";
332-
333-
const string& compilerPath = getCompilerPath();
334-
hipClangInclude = compilerPath;
335-
hipClangInclude = hipClangInclude.parent_path();
336-
hipClangInclude /= "lib/clang/";
337-
hipClangInclude /= compilerVersion;
338-
string hipClangPath = hipClangInclude.string();
339-
340321
const OsType& osInfo = getOSInfo();
341322
if (osInfo == windows) {
342-
cppConfig += " -I" + hipPathInclude.string() + " -I" + hipClangPath;
323+
cppConfig += " -I" + hipPathInclude.string();
343324
cppConfigFs = cppConfig;
344325
cppConfigFs /= "/";
345326
} else {
346327
const string& hsaPath = getHsaPath();
347328
cppConfig += " -I" + hipPathInclude.string() +
348-
" -I" + hipClangPath + " -I" + hsaPath;
329+
" -I" + hsaPath;
349330
cppConfigFs = cppConfig;
350331
cppConfigFs /= "include";
351332
cppConfig = cppConfigFs.string();
@@ -439,23 +420,6 @@ string HipBinAmd::getHipCC() const {
439420
return hipCC;
440421
}
441422

442-
443-
444-
string HipBinAmd::getCompilerIncludePath() {
445-
string hipClangVersion, includePath, compilerIncludePath;
446-
const string& hipClangPath = getCompilerPath();
447-
hipClangVersion = getCompilerVersion();
448-
fs::path includePathfs = hipClangPath;
449-
includePathfs = includePathfs.parent_path();
450-
includePathfs /= "lib/clang/";
451-
includePathfs /= hipClangVersion;
452-
includePathfs /= "include";
453-
includePathfs = fs::absolute(includePathfs).string();
454-
compilerIncludePath = includePathfs.string();
455-
return compilerIncludePath;
456-
}
457-
458-
459423
void HipBinAmd::checkHipconfig() {
460424
printFull();
461425
cout << endl << "Check system installation: " << endl;
@@ -581,14 +545,13 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
581545
HIPCXXFLAGS = getHipCXXFlags();
582546
HIPLDFLAGS = getHipLdFlags();
583547
string hipLibPath;
584-
string hipclangIncludePath , hipIncludePath, deviceLibPath;
548+
string hipIncludePath, deviceLibPath;
585549
hipLibPath = getHipLibPath();
586550
const string& roccmPath = getRoccmPath();
587551
const string& hipPath = getHipPath();
588552
const PlatformInfo& platformInfo = getPlatformInfo();
589553
const string& rocclrHomePath = getRocclrHomePath();
590554
const string& hipClangPath = getCompilerPath();
591-
hipclangIncludePath = getCompilerIncludePath();
592555
hipIncludePath = getHipInclude();
593556
deviceLibPath = getDeviceLibPath();
594557
const string& hipVersion = getHipVersion();
@@ -600,7 +563,6 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
600563
cout << "ROCM_PATH=" << roccmPath << endl;
601564
cout << "HIP_ROCCLR_HOME="<< rocclrHomePath << endl;
602565
cout << "HIP_CLANG_PATH=" << hipClangPath <<endl;
603-
cout << "HIP_CLANG_INCLUDE_PATH="<< hipclangIncludePath <<endl;
604566
cout << "HIP_INCLUDE_PATH="<< hipIncludePath <<endl;
605567
cout << "HIP_LIB_PATH="<< hipLibPath <<endl;
606568
cout << "DEVICE_LIB_PATH="<< deviceLibPath <<endl;

amd/hipcc/src/hipBin_base.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ class HipBinBase {
213213
virtual const string& getCompilerPath() const = 0;
214214
virtual void printCompilerInfo() const = 0;
215215
virtual string getCompilerVersion() = 0;
216-
virtual string getCompilerIncludePath() = 0;
217216
virtual const PlatformInfo& getPlatformInfo() const = 0;
218217
virtual string getCppConfig() = 0;
219218
virtual void checkHipconfig() = 0;

0 commit comments

Comments
 (0)