Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #26 from ROCm-Developer-Tools/develop
Browse files Browse the repository at this point in the history
merge develop into mainline
  • Loading branch information
searlmc1 authored Aug 4, 2022
2 parents 4570b6e + 384b91f commit 1b51ec6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 36 deletions.
1 change: 1 addition & 0 deletions src/hipBin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ void HipBin::executeHipBin(string filename, int argc, char* argv[]) {
cout << "Command " << filename
<< " not supported. Name the exe as hipconfig"
<< " or hipcc and then try again ..." << endl;
exit(-1);
}
}

Expand Down
26 changes: 4 additions & 22 deletions src/hipBin_amd.h
Original file line number Diff line number Diff line change
Expand Up @@ -203,11 +203,6 @@ string HipBinAmd::getHipInclude() const {
void HipBinAmd::initializeHipCXXFlags() {
string hipCXXFlags;
const OsType& os = getOSInfo();
if (os == windows) {
hipCXXFlags = " -std=c++14 -fms-extensions -fms-compatibility";
} else {
hipCXXFlags = " -std=c++11";
}
string hipClangIncludePath;
hipClangIncludePath = getCompilerIncludePath();
hipCXXFlags += " -isystem \"" + hipClangIncludePath;
Expand Down Expand Up @@ -359,13 +354,13 @@ string HipBinAmd::getCppConfig() {
}

string HipBinAmd::getDeviceLibPath() const {
string deviceLibPath;
const EnvVariables& var = getEnvVariables();
const string& rocclrHomePath = getRocclrHomePath();
const string& roccmPath = getRoccmPath();
fs::path bitCodePath = rocclrHomePath;
bitCodePath /= "lib/bitcode";
if (var.deviceLibPathEnv_.empty() && fs::exists(bitCodePath)) {
string deviceLibPath = var.deviceLibPathEnv_;
if (deviceLibPath.empty() && fs::exists(bitCodePath)) {
deviceLibPath = bitCodePath.string();
}

Expand Down Expand Up @@ -1093,7 +1088,6 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
+ deviceLibPath + "\"";
HIPCXXFLAGS += hip_device_lib_str;
}
HIPCXXFLAGS += " -fhip-new-launch-api";
}
if (os != windows) {
HIPLDFLAGS += " -lgcc_s -lgcc -lpthread -lm -lrt";
Expand Down Expand Up @@ -1161,20 +1155,8 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
sysOut = hipBinUtilPtr_->exec(CMD.c_str(), true);
string cmdOut = sysOut.out;
int CMD_EXIT_CODE = sysOut.exitCode;
if (CMD_EXIT_CODE == -1) {
cout << "failed to execute: $!\n";
} else if (CMD_EXIT_CODE & 127) {
string childOut;
int childCode;
(CMD_EXIT_CODE & 127), (CMD_EXIT_CODE & 128) ?
childOut = "with" : childOut = "without";
(CMD_EXIT_CODE & 127), (CMD_EXIT_CODE & 128) ?
childCode = (CMD_EXIT_CODE & 127) :
childCode = (CMD_EXIT_CODE & 128);
cout << "child died with signal " << childCode << "," << childOut <<
" coredump "<< " for cmd: " << CMD << endl;
} else {
CMD_EXIT_CODE = CMD_EXIT_CODE >> 8;
if (CMD_EXIT_CODE !=0) {
cout << "failed to execute:" << CMD << std::endl;
}
exit(CMD_EXIT_CODE);
} // end of runCmd section
Expand Down
16 changes: 2 additions & 14 deletions src/hipBin_nvidia.h
Original file line number Diff line number Diff line change
Expand Up @@ -591,20 +591,8 @@ void HipBinNvidia::executeHipCCCmd(vector<string> argv) {
sysOut = hipBinUtilPtr_->exec(CMD.c_str(), true);
string cmdOut = sysOut.out;
int CMD_EXIT_CODE = sysOut.exitCode;
if (CMD_EXIT_CODE == -1) {
cout << "failed to execute: $!\n";
} else if (CMD_EXIT_CODE & 127) {
string childOut;
int childCode;
(CMD_EXIT_CODE & 127), (CMD_EXIT_CODE & 128) ?
childOut = "with" : childOut = "without";
(CMD_EXIT_CODE & 127), (CMD_EXIT_CODE & 128) ?
childCode = (CMD_EXIT_CODE & 127) :
childCode = (CMD_EXIT_CODE & 128);
cout << "child died with signal " << childCode << "," <<
childOut << " coredump "<< " for cmd: " << CMD << endl;
} else {
CMD_EXIT_CODE = CMD_EXIT_CODE >> 8;
if (CMD_EXIT_CODE !=0) {
cout << "failed to execute:" << CMD << std::endl;
}
exit(CMD_EXIT_CODE);
}
Expand Down

0 comments on commit 1b51ec6

Please sign in to comment.