Currently std::complex and some other std functions require uses to
include hip_runtime.h before any other headers to work, which is not
reliable.
changes are made in clang to fix this issue:
https://reviews.llvm.org/D81176
which requires hipcc and HIP headers to make corresponding changes.
This patch will make sure the clang change will not break
HIP/ROCclr during this transition.
After the transition is done, we can remove explicitly setting
include path for HIP-Clang and HIP header in hipcc and hip config
cmake files and rely on clang driver to set it automatically.
Change-Id: I5d226861c2560ffa6c5ab17343a43cc378048061
Similar to HCC, link with compiler-rt to support __fp16 and _Float16 type conversions in ONNX models. This should resolve SWDEV-238491.
Change-Id: Iad8dcff568831719f501f562a04023326ae8036c
The hipcc script takes arguments and uses this to build up a new
command. Characters which are special to the shell need to be quoted
to prevent them being interpreted.
In particular adding
--Wl,--enable-new-dtags -Wl,--rpath,'$ORIGIN:$ORIGIN/../lib'
to the command should pass quoted dollar signs into the resulting
string so the shell passes them on, rather than substituting the
values.
The arguments are processed in a conventional loop, but can be altered
during the course of the loop, and also by linker response files.
Tested by running
HIPCC_VERBOSE=7 HIP_COMPILER=clang hipcc --cxxflags \
fred.c -Wl,,--rpath,'$ORIGIN:$ORIGIN:/../lib'
and observing "-Wl,--rpath,\$ORIGIN\:\$ORIGIN\:..\/lib" in the
displayed hipcc-cmd output (and ignoring the errors due to rocm not
being installed)
Change-Id: I26b62f09ff3518cceeb85fa8823bb12a95c1c78e
Signed-off-by: Icarus Sparry <icarus.sparry@amd.com>
Before setting the HIP_RUNTIME and HIP_COMPILER variables, first check the environment if these are set. We should prioritize the environment settings. For windows, it will be set, and also explicitly call perl when invoking hipconfig.
Change-Id: I89ad267285239e6d8a897dc681c4af5906e7b9d8
This will update the hipcc script so that it will use HIP_PLATFORM, HIP_COMPILER, and HIP_RUNTIME variables correctly based on updated hipconfig file.
Removing HIP_PLATFORM=clang, only use hcc and nvcc for now. HIP_PLATFORM should eventually switch to amd or nvcc.
Change-Id: Ie527d07a1add974cc3aab8e9f61b0518147d7602
Add support for hipconfig to display details on HIP-Clang compiler and update HIP_COMPILER and HIP_RUNTIME to include clang and rocclr. Also, add hipcc flags --cxxflags and --ldflags to support HCC users who used hccconfig flags.
Change-Id: Ib12d81a4ff59d34fb000626836b1adb10be3ac61
This change is required by rocBLAS and rocFFT for OpenMP issue
since cmake needs to treat .cpp file as C++ program to detect
OpenMP support.
This is to match nvcc behavior, speed up compilation of C++
programs, and fix some compilation issue where C++ programs
are compiled as HIP programs.
Currently it is controlled by an environment variable
HIP_COMPILE_CXX_AS_HIP. By default it is 1, where
hipcc treats .cpp files as HIP programs. If it is
set to 0, hipcc will treat .cpp files as C++ programs.
This is because some math libraries are still not
ready for the change, however rocBLAS and rocFFT
require this feature for OpenMP, therefore put it
under an environment variable so that rocBLAS
and rocFFT can use it.
Change-Id: I56a51e27079df850ee39d4217fb647c22d79f612
1.Combine libamdhip64_static_base.a and libamdvdi_static.a into libamdhip64_static.a.
2.Let hipcc use -use-staticlib to link libamdhip64_static.a.
3.Add some samples for static lib.
4.Fix compiling failure of code object.
Change-Id: Ic8c95228eb139058da8b5d66ba8439486154ca6f
This reverts commit 4c2ab3f41e.
Reason for revert: It is causing dkms-no-npi-hipclang broken.
It is top priority to maintain dkms-no-npi-hipclang build, otherwise we lose track of regression analysis.
So revert the change for now and recommit it after fixing it.
Change-Id: Ia5136e888baecb6148c6c18eedbf37066fcb1eaa
1.Combine libamdhip64_static_base.a and libamdvdi_static.a into libamdhip64_static.a.
2.Let hipcc use -use-staticlib to link libamdhip64_static.a.
3.Add some samples for static lib.
4.Fix compiling failure of code object.
Change-Id: Ia2333622a8d05639b90974c4c5d3d85654ba0138
Fixes SWDEV-207362,
The output file name should not contribute to picking up the right flags for the compiler. This fix solves issues when the output has conflicting extensions which confuses hipcc to treat them as the source files and add the required flags for them.
PS: Output file refers to the file followed by -o
Change-Id: I1095966c11143ad73e81fabc35b4e9de5d3afada
Example: hipcc test.o -o test.hip will add the flags for .hip compilation ignoring the fact that it is an output file
By default hipcc passes -mllvm options to let HIP-Clang inline all device functions.
--hipcc-func-supp enables function support and disables inline all.
--hipcc-no-func-supp disable function support and enables inline all.
This is a temporary solution to match HCC behavior for performance.
This option is mainly for debugging purpose.
Change-Id: I0c44ac1812bb3cea5c3e5b6e14ebaa45919236f6
nvcc treats .c program as C program and .cpp program as C++ program.
Currently hipcc treats .c and .cpp programs as HIP programs.
It is desirable to let hipcc behave like nvcc.
Currently it is not feasible to let hipcc treat .cpp programs as C++ program
since there are too many HIP applications use .cpp as extension for HIP programs.
However we should be able let hipcc treat .c program C program since there
are few applications use .c as extensioin for HIP programs.
HIP-Clang cuda_wrapper headers require clang include path before standard C++ include path.
However libc++ include path requires to be before clang include path.
To workaround this, we pass -isystem with the parent directory of clang include
path instead of the clang include path itself.