Skip to content

HIP: Add support for HIP runtime in system paths

Cordell Bloor requested to merge cgmb/cmake:hip-system-paths into master
  • Fix search for hip-lang in system paths

hip-lang-config.cmake may be stored in /usr/lib/<triple>/hip-lang on Debian or in /usr/lib64/hip-lang on Fedora, so the target architecture needs to be determined before trying to find the package. The HIP language cannot do that before finding hip-lang, so the user may need to enable the C or CXX languages before HIP.

  • Warn if HIP is enabled before C or CXX

Some of the standard system paths won't be searched if HIP is the first language enabled, so warn users that they should be enabling another language first.

  • Conditionally enable C and CXX in try_compile for HIP

It may be necessary to enable the C or CXX languages before HIP, so when the user has enabled the C or CXX languages in their global project, the same languages should be enabled in try_compile.

  • Add /usr/include to implicit include dirs for ABI check

The CMAKE_<LANG>_IMPLICIT_INCLUDE_DIRECTORIES are computed using try_compile in CMAKE_DETERMINE_COMPILER_ABI, but the implicit include directories aren't known until after try_compile is complete. This can be a problem when the HIP runtime include path is /usr/include, because the runtime include path is always added to the userDirs and the compiler implicitly includes standard library headers via the __clang_hip_runtime_wrapper.

Closes: #24562 (closed)

Edited by Cordell Bloor

Merge request reports