There is soft link /opt/rocm/bin/.hipVersion, therefore when hipcc is executed
as /opt/rocm/bin/hipcc, it will set HIP_VDI_HOME to /opt/rocm, which is
incorrect. Check ../lib/bitcode instead to identify HIP_VDI_HOME.
* Fix hipcc for hip-clang.
If there is -g, do not add -O3 by default.
If HIP_VDI_HOME is not set, set HIP_VDI_HOME based on hipcc directory for HIP/VDI runtime.
For HIP/VDI runtime, set HIP_CLANG_PATH and DEVICE_LIB_PATH based on HIP_VDI_HOME only if they exist.
This allows using HIP/VDI runtime with hip-clang installed at /opt/rocm/llvm and device lib installed
at /opt/rocm/lib.
* Fix HIP_VDI_HOME for hipcc called from /opt/rocm/bin
- With `--rpath`, app's RUNPATH is set to the temporary library path
during build. Instead, `--rpath-link` should be used to leave RUNPATH
untouched. User should set LD_LIBRARY_PATH or system ld.so.conf to
proper setting.
* Add CMAKE dep to amd_comgr
* Use COMGR for read_kernarg_metadata in COV2
* Do not assume kernargs exist
* Add proper metadata destroy cleanup
* Use a process function for easier destroy
* Remove old read_kernarg_metadata
* Clean up HCC, prints, names
* Use COMGR in CMAKE by default
* Move metadata lookup for keyword values into helper
* Remove C string usage for lookup_keyword_value
* Guard COMGR for non-NVCC path
* Add hip_hcc dependency on comgr package
* Add lifetime to metadata nodes
* Find COMGR config file for amd_comgr target
* Move set_active data earlier
HIP_PLATFORM detection logic relied on finding a working KFD. If it was
found, the platform was set as hcc else as nvcc.
However this logic is flawed since it is possible for the development
system to only have the user mode bits to build HIP application code.
Hence the better logic is to rely on finding a suitable compiler.
The new logic is as follows:
- look for a working HCC. If found, platform is set as hcc.
- else look for a working NVCC. If found, platform is set as nvcc.
- else the platform defaults to hcc for now.
Change-Id: Ifcc42c29a19f722153d5c23c55f1a8765dceaf6b
Disable linux specific compilation and linking options for windows.
In hip_vector_types.h, hip-clang needs HIP's own implementation for vector types even
on windows. MSVC specific implementation is for building runtime itself, which is compiled
by MSVC.
Add HIP_COMPILER to hipConfig, so that HIP packages built with HIP_COMPILER for HIP-Clang will be known during runtime by hipcc. Also add default locations to check for llvm and device-libs.
Move remaining function definitions from device_util.cpp to hip_runtime.h header. We can now remove the static library completely as device_util.cpp was the last file part of target hip::hip_device .