Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Default to using the ROCm hcc installation if no other are found #129

Open
wants to merge 1 commit into
base: clang_tot_upgrade
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions lib/Driver/ToolChains/Hcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ HCCInstallationDetector::HCCInstallationDetector(const Driver &D, const llvm::op
HCCPathCandidates.push_back(
Args.getLastArgValue(options::OPT_hcc_path_EQ));

HCCPathCandidates.push_back(InstallPath + "/..");
HCCPathCandidates.push_back(BinPath + "/..");
HCCPathCandidates.push_back(BinPath + "/../..");
HCCPathCandidates.push_back(InstallPath + "/..");
HCCPathCandidates.push_back(RocmInstallation + "/hcc");

for (const auto &HCCPath: HCCPathCandidates) {
if (HCCPath.empty() ||
Expand All @@ -68,7 +68,8 @@ HCCInstallationDetector::HCCInstallationDetector(const Driver &D, const llvm::op
void HCCInstallationDetector::AddHCCIncludeArgs(const llvm::opt::ArgList &DriverArgs, llvm::opt::ArgStringList &CC1Args) const {
if (IsValid) {
CC1Args.push_back(DriverArgs.MakeArgString("-I" + IncPath + "/include"));
CC1Args.push_back(DriverArgs.MakeArgString("-I" + IncPath + "/hcc/include"));
// fall back to /opt/rocm/include if the user includes <hcc/hc.hpp>
CC1Args.push_back(DriverArgs.MakeArgString("-I" + RocmInstallation + "/include"));
}
}

Expand Down
1 change: 1 addition & 0 deletions lib/Driver/ToolChains/Hcc.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class HCCInstallationDetector {
std::string IncPath;
std::string LibPath;

const std::string RocmInstallation = "/opt/rocm";
std::vector<const char *> SystemLibs = {"-ldl", "-lm", "-lpthread", "-lunwind"};
std::vector<const char *> RuntimeLibs = {"-lhc_am", "-lmcwamp"};

Expand Down