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

[Feature]: Support executing Clang through a wrapper/launcher for caching #72

Open
GZGavinZhao opened this issue Jan 17, 2024 · 0 comments
Labels
hipcc Related to HIPCC

Comments

@GZGavinZhao
Copy link

GZGavinZhao commented Jan 17, 2024

Suggestion Description

See ROCm/ROCm#2817 for a more detailed description and motivation.

It would be greatly beneficial for developer productivity and distro packagers' convenience if we can introduce a wrapper executable to launch the Clang executable. This will allow us to cache HIP compilations to massively speed up builds that have very few code changes, similar to how ccache and sccache can cache C/C++ and Rust builds. For example, when specifying sccache as the wrapper, instead of executing $ROCM_PATH/llvm/bin/clang --offload-arch=..., sccache $ROCM_PATH/llvm/bin/clang --offload-arch=... is executed. CMake's HIP support can already do the equivalent using the environment variable CMAKE_HIP_COMPILER_LAUNCHER.

The way I propose this feature be implemented is to introduce the environment variable HIP_CLANG_LAUNCHER, which is analogous the CMake variable CMAKE_HIP_COMPILER_LAUNCHER. A PR implementing this feature can be found at ROCm/HIPCC#148. This feature is used to package the entire ROCm stack for Solus Linux, so it has been pretty thoroughly tested.

This feature by itself is not very useful, but is very powerful when combined with compiler wrappers that cache compilations. After HIP support in sccache is implemented this will allow us to cache HIP compilations. Please see ROCm/ROCm#2817 for more details on this.

Operating System

No response

GPU

No response

ROCm Component

HIPCC

@dgaliffiAMD dgaliffiAMD added the hipcc Related to HIPCC label May 4, 2024
@lamb-j lamb-j transferred this issue from ROCm/HIPCC May 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
hipcc Related to HIPCC
Projects
None yet
2 participants