23#ifndef SRC_HIPBIN_AMD_H_
24#define SRC_HIPBIN_AMD_H_
26#include "hipBin_base.h"
27#include "hipBin_util.h"
31#include <unordered_set>
36#define assertm(exp, msg) assert(((void)msg, exp))
40 <std::string> knownFeatures = {
"sramecc-" ,
"sramecc+",
46 string hipClangPath_ =
"";
47 string roccmPathEnv_, hipRocclrPathEnv_, hsaPathEnv_;
49 string hipCFlags_, hipCXXFlags_, hipLdFlags_;
50 void constructRocclrHomePath();
51 void constructHsaPath();
56 virtual bool detectPlatform();
57 virtual void constructCompilerPath();
58 virtual const string& getCompilerPath()
const;
60 virtual string getCppConfig();
61 virtual void printFull();
62 virtual void printCompilerInfo()
const;
63 virtual string getCompilerVersion();
64 virtual void checkHipconfig();
65 virtual string getDeviceLibPath()
const;
66 virtual string getHipLibPath()
const;
67 virtual string getHipCC()
const;
68 virtual string getHipInclude()
const;
69 virtual void initializeHipCXXFlags();
70 virtual void initializeHipCFlags();
71 virtual void initializeHipLdFlags();
72 virtual const string& getHipCXXFlags()
const;
73 virtual const string& getHipCFlags()
const;
74 virtual const string& getHipLdFlags()
const;
75 virtual void executeHipCCCmd(vector<string> argv);
77 const string& getHsaPath()
const;
78 const string& getRocclrHomePath()
const;
81HipBinAmd::HipBinAmd() {
83 platformInfo.os = getOSInfo();
84 platformInfo.platform = amd;
85 platformInfo.runtime = rocclr;
86 platformInfo.compiler = clang;
87 platformInfoAMD_ = platformInfo;
91void HipBinAmd::constructRocclrHomePath() {
92 fs::path full_path(fs::current_path());
93 fs::path hipvars_dir = full_path;
94 fs::path bitcode = hipvars_dir;
95 string rocclrHomePath = getEnvVariables().hipRocclrPathEnv_;
96 if (rocclrHomePath.empty()) {
97 bitcode /=
"../lib/bitcode";
98 if (!fs::exists(bitcode)) {
99 rocclrHomePath = getHipPath();
102 rocclrHomePath = hipvars_dir.string();
105 hipRocclrPathEnv_ = rocclrHomePath;
110void HipBinAmd::constructHsaPath() {
112 string hsaPath = getEnvVariables().hsaPathEnv_;
113 if (hsaPath.empty()) {
114 hsaPath = getRoccmPath();
117 hsaPath = hsaPathfs.string();
118 hsaPathEnv_ = hsaPath;
120 hsaPathEnv_ = hsaPath;
125const string& HipBinAmd::getRocclrHomePath()
const {
126 return hipRocclrPathEnv_;
130const string& HipBinAmd::getHsaPath()
const {
136const string& HipBinAmd::getHipCFlags()
const {
141const string& HipBinAmd::getHipLdFlags()
const {
146void HipBinAmd::initializeHipLdFlags() {
149 const string& hipClangPath = getCompilerPath();
151 string hipCC =
"\"" + hipClangPath +
"/clang++";
152 if (!fs::exists(hipCC)) {
153 hipLdFlags =
"--driver-mode=g++";
155 hipLibPath = getHipLibPath();
156 hipLdFlags +=
" -L\"" + hipLibPath +
"\"";
157 const OsType& os = getOSInfo();
159 hipLdFlags +=
" -lamdhip64";
161 hipLdFlags_ = hipLdFlags;
164void HipBinAmd::initializeHipCFlags() {
166 const OsType& os = getOSInfo();
169 hsaPath = getHsaPath();
170 hipCFlags +=
" -isystem " + hsaPath +
"/include";
172 string hipIncludePath;
173 hipIncludePath = getHipInclude();
174 hipCFlags +=
" -isystem \"" + hipIncludePath +
"\"";
175 hipCFlags_ = hipCFlags;
178const string& HipBinAmd::getHipCXXFlags()
const {
183string HipBinAmd::getHipInclude()
const {
184 const string& rocclrHomePath = getRocclrHomePath();
185 fs::path hipIncludefs = rocclrHomePath;
186 hipIncludefs /=
"include";
187 if (hipIncludefs.string().empty()) {
188 const string& hipPath = getHipPath();
189 hipIncludefs = hipPath;
190 hipIncludefs /=
"include";
192 string hipInclude = hipIncludefs.string();
197void HipBinAmd::initializeHipCXXFlags() {
199 const OsType& os = getOSInfo();
202 if (var.hipClangHccCompactModeEnv_.compare(
"1") == 0) {
204 " -Xclang -fallow-half-arguments-and-returns -D__HIP_HCC_COMPAT_MODE__=1";
208 const string& hsaPath = getHsaPath();
209 hipCXXFlags +=
" -isystem " + hsaPath +
"/include";
212 string hipIncludePath;
213 hipIncludePath = getHipInclude();
214 hipCXXFlags +=
" -isystem \"" + hipIncludePath +
"\"";
215 hipCXXFlags_ = hipCXXFlags;
219void HipBinAmd::constructCompilerPath() {
222 if (envVariables.hipClangPathEnv_.empty()) {
223 fs::path hipClangPath;
224 const OsType& osInfo = getOSInfo();
225 if (osInfo == windows) {
226 complierPath = getHipPath();
227 hipClangPath = complierPath;
229 complierPath = getRoccmPath();
230 hipClangPath = complierPath;
232 if (fs::exists(
"llvm/bin/clang++")) {
233 hipClangPath /=
"llvm/bin";
235 hipClangPath /=
"bin";
237 complierPath = hipClangPath.string();
239 complierPath = envVariables.hipClangPathEnv_;
241 hipClangPath_ = complierPath;
245const string& HipBinAmd::getCompilerPath()
const {
246 return hipClangPath_;
249void HipBinAmd::printCompilerInfo()
const {
250 const OsType& os = getOSInfo();
251 const string& hipClangPath = getCompilerPath();
252 const string& hipPath = getHipPath();
254 string cmd = hipClangPath +
"/clang++ --version";
256 cout <<
"llc-version :" << endl;
257 cmd = hipClangPath +
"/llc --version";
259 cout <<
"hip-clang-cxxflags :" << endl;
260 cmd = hipPath +
"/bin/hipcc --cxxflags";
262 cout << endl <<
"hip-clang-ldflags :" << endl;
263 cmd = hipPath +
"/bin/hipcc --ldflags";
267 string cmd = hipClangPath +
"/clang++ --version";
269 cmd = hipClangPath +
"/llc --version";
271 cout <<
"hip-clang-cxxflags :" << endl;
272 cmd = hipPath +
"/bin/hipcc --cxxflags";
274 cout << endl <<
"hip-clang-ldflags :" << endl;
275 cmd = hipPath +
"/bin/hipcc --ldflags";
281string HipBinAmd::getCompilerVersion() {
282 string out, complierVersion;
283 const string& hipClangPath = getCompilerPath();
284 fs::path cmdAmd = hipClangPath;
286 if (canRunCompiler(cmdAmd.string(), out) || canRunCompiler(
"clang++", out)) {
287 regex regexp(
"([0-9.]+)");
289 if (regex_search(out, m, regexp)) {
292 std::ssub_match sub_match = m[1];
293 complierVersion = sub_match.str();
297 std::cerr <<
"Hip Clang Compiler not found" << endl;
299 return complierVersion;
305 return platformInfoAMD_;
309string HipBinAmd::getCppConfig() {
310 string cppConfig =
" -D__HIP_PLATFORM_HCC__= -D__HIP_PLATFORM_AMD__=";
312 string compilerVersion;
313 compilerVersion = getCompilerVersion();
315 fs::path hipPathInclude, cppConfigFs;
316 const string& hipPath = getHipPath();
317 hipPathInclude = hipPath;
318 hipPathInclude /=
"include";
319 const OsType& osInfo = getOSInfo();
320 if (osInfo == windows) {
321 cppConfig +=
" -I" + hipPathInclude.string();
322 cppConfigFs = cppConfig;
325 const string& hsaPath = getHsaPath();
326 cppConfig +=
" -I" + hipPathInclude.string() +
328 cppConfigFs = cppConfig;
329 cppConfigFs /=
"include";
330 cppConfig = cppConfigFs.string();
335string HipBinAmd::getDeviceLibPath()
const {
337 string deviceLibPath = var.deviceLibPathEnv_;
338 return deviceLibPath;
342bool HipBinAmd::detectPlatform() {
344 const string& hipClangPath = getCompilerPath();
345 fs::path cmdAmd = hipClangPath;
348 bool detected =
false;
349 if (var.hipPlatformEnv_.empty()) {
350 if (canRunCompiler(cmdAmd.string(), out) ||
351 (canRunCompiler(
"clang++", out))) {
355 if (var.hipPlatformEnv_ ==
"amd" ||
356 var.hipPlatformEnv_ ==
"hcc") {
358 if (var.hipPlatformEnv_ ==
"hcc")
360 "Warning: HIP_PLATFORM=hcc is deprecated."<<
361 "Please use HIP_PLATFORM=amd." << endl;
367string HipBinAmd::getHipLibPath()
const {
370 if (env.hipLibPathEnv_.empty()) {
371 const string& rocclrHomePath = getRocclrHomePath();
372 fs::path libPath = rocclrHomePath;
374 hipLibPath = libPath.string();
376 if (hipLibPath.empty()) {
377 const string& hipPath = getHipPath();
378 fs::path libPath = hipPath;
380 hipLibPath = libPath.string();
385string HipBinAmd::getHipCC()
const {
387 const string& hipClangPath = getCompilerPath();
388 fs::path compiler = hipClangPath;
389 compiler /=
"clang++";
390 if (!fs::exists(compiler)) {
391 fs::path compiler = hipClangPath;
394 hipCC = compiler.string();
398void HipBinAmd::checkHipconfig() {
400 cout << endl <<
"Check system installation: " << endl;
401 cout <<
"check hipconfig in PATH..." << endl;
402 if (system(
"which hipconfig > /dev/null 2>&1") != 0) {
403 std::cerr <<
"FAIL " << endl;
405 cout <<
"good" << endl;
407 string ldLibraryPath;
409 ldLibraryPath = env.ldLibraryPathEnv_;
410 const string& hsaPath = getHsaPath();
411 cout <<
"check LD_LIBRARY_PATH (" << ldLibraryPath <<
412 ") contains HSA_PATH (" << hsaPath <<
")..." << endl;
413 if (ldLibraryPath.find(hsaPath) == string::npos) {
414 std::cerr <<
"FAIL" << endl;
416 cout <<
"good" << endl;
420void HipBinAmd::printFull() {
421 const string& hipVersion = getHipVersion();
422 const string& hipPath = getHipPath();
423 const string& roccmPath = getRoccmPath();
425 const string& ccpConfig = getCppConfig();
426 const string& hsaPath = getHsaPath();
427 const string& hipClangPath = getCompilerPath();
429 cout <<
"HIP version: " << hipVersion << endl;
430 cout << endl <<
"==hipconfig" << endl;
431 cout <<
"HIP_PATH :" << hipPath << endl;
432 cout <<
"ROCM_PATH :" << roccmPath << endl;
433 cout <<
"HIP_COMPILER :" << CompilerTypeStr(
434 platformInfo.compiler) << endl;
435 cout <<
"HIP_PLATFORM :" << PlatformTypeStr(
436 platformInfo.platform) << endl;
437 cout <<
"HIP_RUNTIME :" << RuntimeTypeStr(
438 platformInfo.runtime) << endl;
439 cout <<
"CPP_CONFIG :" << ccpConfig << endl;
441 cout << endl <<
"==hip-clang" << endl;
442 cout <<
"HSA_PATH :" << hsaPath << endl;
443 cout <<
"HIP_CLANG_PATH :" << hipClangPath << endl;
445 cout << endl <<
"== Envirnoment Variables" << endl;
446 printEnvironmentVariables();
448 if (fs::exists(
"/usr/bin/lsb_release"))
449 system(
"/usr/bin/lsb_release -a");
454void HipBinAmd::executeHipCCCmd(vector<string> argv) {
455 if (argv.size() < 2) {
456 cout<<
"No Arguments passed, exiting ...\n";
461 if (!var.verboseEnv_.empty())
462 verbose = stoi(var.verboseEnv_);
468 bool default_amdgpu_target = 1;
469 bool compileOnly = 0;
470 bool needCXXFLAGS = 0;
472 bool needLDFLAGS = 1;
473 bool fileTypeFlag = 0;
474 bool hasOMPTargets = 0;
480 bool printHipVersion = 0;
481 bool printCXXFlags = 0;
482 bool printLDFlags = 0;
486 bool setLinkType = 0;
495 vector<string> options, inputs;
500 vector<string> targetOpts = {
"--offload-arch=",
"--amdgpu-target="};
503 bool skipOutputFile =
false;
505 const OsType& os = getOSInfo();
506 string hip_compile_cxx_as_hip;
507 if (var.hipCompileCxxAsHipEnv_.empty()) {
508 hip_compile_cxx_as_hip =
"1";
510 hip_compile_cxx_as_hip = var.hipCompileCxxAsHipEnv_;
513 string HIPLDARCHFLAGS;
514 string HIPCXXFLAGS, HIPCFLAGS, HIPLDFLAGS;
518 for (
unsigned int argcount = 1; argcount < argv.size(); argcount++) {
520 string arg = argv.at(argcount);
525 regex toRemove(
"\\s+");
527 string trimarg = hipBinUtilPtr_->replaceRegex(arg, toRemove,
"");
528 bool swallowArg =
false;
529 bool escapeArg =
true;
530 if (arg ==
"-c" || arg ==
"--genco" || arg ==
"-E") {
535 if (skipOutputFile) {
537 toolArgs +=
" \"" + arg +
"\"";
548 if ((trimarg ==
"-stdlib=libc++") && (setStdLib == 0)) {
549 HIPCXXFLAGS +=
" -stdlib=libc++";
554 const string& rocmPathOption =
"--rocm-path=";
555 if (arg.compare(0,rocmPathOption.length(),rocmPathOption) == 0)
556 rocm_pathOption_ = arg.substr(rocmPathOption.length());
559 for (
unsigned int i = 0; i <targetOpts.size(); i++) {
560 string targetOpt = targetOpts.at(i);
562 string pattern =
"^" + targetOpt +
".*";
563 if (hipBinUtilPtr_->stringRegexMatch(arg, pattern)) {
564 if (targetOpt ==
"--amdgpu-target=") {
565 std::cerr <<
"Warning: The --amdgpu-target option has been deprecated and will be removed in the future."
566 <<
" Use --offload-arch instead.\n";
570 targetsStr.size() >0 ? targetsStr +=
",": targetsStr +=
"";
571 targetsStr += arg.substr(targetOpt.size());
572 default_amdgpu_target = 0;
578 if (hipBinUtilPtr_->substringPresent(arg,
"--genco")) {
579 arg =
"--cuda-device-only";
582 if (trimarg ==
"--version") {
585 if (trimarg ==
"--short-version") {
589 if (trimarg ==
"--cxxflags") {
593 if (trimarg ==
"--ldflags") {
597 if (trimarg ==
"-M") {
601 if ((trimarg ==
"-use-staticlib") && (setLinkType == 0)) {
606 if ((trimarg ==
"-use-sharedlib") && (setLinkType == 0)) {
610 if (hipBinUtilPtr_->stringRegexMatch(arg,
"^-O.*")) {
613 if (hipBinUtilPtr_->substringPresent(
614 arg,
"--amdhsa-code-object-version=")) {
615 std::cerr <<
"Warning: The --amdhsa-code-object-version option has been deprecated and will be removed in the future."
616 <<
" Use -mllvm -mcode-object-version instead.\n";
617 arg = hipBinUtilPtr_->replaceStr(
618 arg,
"--amdhsa-code-object-version=",
"");
625 }
else if ((arg ==
"c" && prevArg ==
"-x") || (arg ==
"-xc")) {
630 }
else if ((arg ==
"c++" && prevArg ==
"-x") || (arg ==
"-xc++")) {
635 }
else if ((arg ==
"hip" && prevArg ==
"-x") || (arg ==
"-xhip")) {
640 }
else if (hipBinUtilPtr_->substringPresent(arg,
"-fopenmp-targets=")) {
643 }
else if (hipBinUtilPtr_->stringRegexMatch(arg,
"^-.*")) {
644 if (arg ==
"-fgpu-rdc") {
646 }
else if (arg ==
"-fno-gpu-rdc") {
650 if (hipBinUtilPtr_->stringRegexMatch(arg,
"^--hipcc.*")) {
652 if (arg ==
"--hipcc-func-supp") {
653 std::cerr <<
"Warning: The --hipcc-func-supp option has been deprecated and will be removed in the future.\n";
655 }
else if (arg ==
"--hipcc-no-func-supp") {
656 std::cerr <<
"Warning: The --hipcc-no-func-supp option has been deprecated and will be removed in the future.\n";
660 options.push_back(arg);
663 }
else if (prevArg !=
"-o") {
671 if (fileTypeFlag == 0) {
672 if (hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.c$")) {
676 }
else if ((hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.cpp$")) ||
677 (hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.cxx$")) ||
678 (hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.cc$")) ||
679 (hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.C$"))) {
681 if (hip_compile_cxx_as_hip ==
"0" || hasOMPTargets == 1) {
685 toolArgs +=
" -x hip";
687 }
else if (((hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.cu$") ||
688 hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.cuh$")) &&
689 hip_compile_cxx_as_hip !=
"0") ||
690 (hipBinUtilPtr_->stringRegexMatch(arg,
".*\\.hip$"))) {
693 toolArgs +=
" -x hip";
698 }
else if (hasCXX || hasHIP) {
701 inputs.push_back(arg);
710 if (os != windows && escapeArg) {
711 regex reg(
"[^-a-zA-Z0-9_=+,.\\/]");
712 arg = regex_replace(arg, reg,
"\\$&");
715 toolArgs +=
" " + arg;
720 constructRoccmPath();
723 constructCompilerPath();
724 constructRocclrHomePath();
727 initializeHipCXXFlags();
728 initializeHipCFlags();
729 initializeHipLdFlags();
730 HIPCFLAGS = getHipCFlags();
731 HIPCXXFLAGS = getHipCXXFlags();
732 HIPLDFLAGS = getHipLdFlags();
735 string hipIncludePath, deviceLibPath;
736 hipLibPath = getHipLibPath();
737 const string& roccmPath = getRoccmPath();
738 const string& hipPath = getHipPath();
740 const string& rocclrHomePath = getRocclrHomePath();
741 const string& hipClangPath = getCompilerPath();
742 hipIncludePath = getHipInclude();
743 deviceLibPath = getDeviceLibPath();
744 const string& hipVersion = getHipVersion();
746 cout <<
"HIP_PATH=" << hipPath << endl;
747 cout <<
"HIP_PLATFORM=" << PlatformTypeStr(platformInfo.platform) <<endl;
748 cout <<
"HIP_COMPILER=" << CompilerTypeStr(platformInfo.compiler) <<endl;
749 cout <<
"HIP_RUNTIME=" << RuntimeTypeStr(platformInfo.runtime) <<endl;
750 cout <<
"ROCM_PATH=" << roccmPath << endl;
751 cout <<
"HIP_ROCCLR_HOME="<< rocclrHomePath << endl;
752 cout <<
"HIP_CLANG_PATH=" << hipClangPath <<endl;
753 cout <<
"HIP_INCLUDE_PATH="<< hipIncludePath <<endl;
754 cout <<
"HIP_LIB_PATH="<< hipLibPath <<endl;
755 cout <<
"DEVICE_LIB_PATH="<< deviceLibPath <<endl;
759 cout <<
"hipcc-args: ";
760 for (
unsigned int i = 1; i< argv.size(); i++) {
761 cout << argv.at(i) <<
" ";
767 if (default_amdgpu_target == 1) {
768 if (!var.hccAmdGpuTargetEnv_.empty()) {
769 targetsStr = var.hccAmdGpuTargetEnv_;
770 }
else if (os != windows) {
772 string ROCM_AGENT_ENUM;
773 ROCM_AGENT_ENUM = roccmPath +
"/bin/rocm_agent_enumerator";
774 targetsStr = ROCM_AGENT_ENUM +
" -t GPU";
775 SystemCmdOut sysOut = hipBinUtilPtr_->exec(targetsStr.c_str());
776 regex toReplace(
"\n+");
777 targetsStr = hipBinUtilPtr_->replaceRegex(sysOut.out, toReplace,
",");
779 default_amdgpu_target = 0;
783 vector<string> targets = hipBinUtilPtr_->splitStr(targetsStr,
',');
784 string GPU_ARCH_OPT =
" --offload-arch=";
786 for (
auto &val : targets) {
788 if (val !=
"gfx000") {
789 vector<string> procAndFeatures = hipBinUtilPtr_->splitStr(val,
':');
790 size_t len = procAndFeatures.size();
792 assertm(procAndFeatures.size() >= 1,
"Pass the correct device/feature");
793 for (
size_t i = 1; i < len; i++) {
797 if (knownFeatures.find(procAndFeatures.at(i)) == knownFeatures.end()) {
798 std::cerr <<
"Warning: The Feature: "<< procAndFeatures.at(i) <<
799 " is unknown. Correct compilation is not guaranteed.\n";
803 GPU_ARCH_ARG = GPU_ARCH_OPT + val;
805 HIPLDARCHFLAGS += GPU_ARCH_ARG;
807 HIPCXXFLAGS += GPU_ARCH_ARG;
811 string HCC_EXTRA_LIBRARIES;
812 if (hsacoVersion.size() > 0) {
813 if (compileOnly == 0) {
814 HIPLDFLAGS +=
" -mcode-object-version=" + hsacoVersion;
816 HIPCXXFLAGS +=
" -mcode-object-version=" + hsacoVersion;
821 if (default_amdgpu_target == 1 && compileOnly == 0) {
823 std::cerr <<
"No valid AMD GPU target was either specified or found."
824 <<
"Please specify a valid target using --offload-arch=<target>.\n";
826 HCC_EXTRA_LIBRARIES =
"\n";
829 HIPCXXFLAGS +=
" --cuda-host-only";
832 if (rdc && !compileOnly) {
833 HIPLDFLAGS +=
" --hip-link";
834 HIPLDFLAGS += HIPLDARCHFLAGS;
844 if (optArg.empty()) {
845 HIPCXXFLAGS +=
" -O3";
847 HIPLDFLAGS +=
" -O3";
850 if (!funcSupp && optArg !=
"-O0" && hasHIP) {
852 " -mllvm -amdgpu-early-inline-all=true -mllvm -amdgpu-function-calls=false";
853 if (needLDFLAGS && !needCXXFLAGS) {
855 " -mllvm -amdgpu-early-inline-all=true"
856 " -mllvm -amdgpu-function-calls=false";
861 if (!deviceLibPath.empty()) {
862 string hip_device_lib_str =
" --hip-device-lib-path=\""
863 + deviceLibPath +
"\"";
864 HIPCXXFLAGS += hip_device_lib_str;
868 HIPLDFLAGS +=
" -lgcc_s -lgcc -lpthread -lm -lrt";
871 if (os != windows && !compileOnly) {
872 string hipClangVersion, toolArgTemp;
874 toolArgTemp =
" -L"+ hipLibPath +
"-lamdhip64 -L" +
875 roccmPath+
"/lib -lhsa-runtime64 -ldl -lnuma " + toolArgs;
876 toolArgs = toolArgTemp;
878 toolArgTemp = toolArgs +
" -Wl,-rpath=" + hipLibPath +
":"
879 + roccmPath+
"/lib -lamdhip64 ";
880 toolArgs = toolArgTemp;
883 hipClangVersion = getCompilerVersion();
885 toolArgs +=
" -L" + hipClangPath +
"/../lib/clang/" +
886 hipClangVersion +
"/lib/linux -lclang_rt.builtins-x86_64 ";
888 if (!var.hipccCompileFlagsAppendEnv_.empty()) {
889 HIPCXXFLAGS +=
" " + var.hipccCompileFlagsAppendEnv_ +
" ";
890 HIPCFLAGS +=
" " + var.hipccCompileFlagsAppendEnv_ +
" ";
892 if (!var.hipccLinkFlagsAppendEnv_.empty()) {
893 HIPLDFLAGS +=
" " + var.hipccLinkFlagsAppendEnv_ +
" ";
897 compiler = getHipCC();
898 string CMD = compiler;
900 CMD +=
" " + HIPCFLAGS;
904 CMD +=
" " + HIPCXXFLAGS;
907 if (needLDFLAGS && !compileOnly) {
908 CMD +=
" " + HIPLDFLAGS;
911 CMD +=
" " + toolArgs;
913 cout <<
"hipcc-cmd: " << CMD <<
"\n";
916 if (printHipVersion) {
918 cout <<
"HIP version: ";
920 cout << hipVersion << endl;
930 sysOut = hipBinUtilPtr_->exec(CMD.c_str(),
true);
931 string cmdOut = sysOut.out;
932 int CMD_EXIT_CODE = sysOut.exitCode;
933 if (CMD_EXIT_CODE !=0) {
934 std::cerr <<
"failed to execute:" << CMD << std::endl;
Definition hipBin_amd.h:43
Definition hipBin_base.h:207
Definition hipBin_util.h:144
Definition hipBin_base.h:141
Definition hipBin_util.h:138