-
Notifications
You must be signed in to change notification settings - Fork 75
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
[HIPIFY] Macros not evaluated #281
Comments
It is intentionally so; the point is to hipify all preprocessor conditional branches presented in the source CUDA code, and it is the default (hipify-clang's, not clang's) behaviour. To switch to the compiler's default behaviour, when blocks under false conditional branches are removed by the preprocessor from the further compilation, the hipify-clang's option P.S. |
Thanks for the explanation. Of course it would have been much nicer if all preprocessor conditional branches were evaluated separately such that redefining a variable in the |
Hipify-clang is not actually a compiler even it is based on clang's FE. It is a converter and its main task is to convert as much as possible from one source code written in CUDA to another, written in HIP, including the code under conditional macros. But you're right, that this aspect is not obvious, when you get a compilation error on a valid C++ code. After implementing #1 the issue you reported will go away regardless of either |
Closing as answered. |
The code I am trying to hipify looks like that
The command I issue is
hipify-clang test.cu --cuda-path=/usr/local/cuda
and the error message is:Obviously clang tries to evaluate the
#if 0
code block, which is incorrect. I installed version 12.0.0 from the ROCm repository on Centos 7.The text was updated successfully, but these errors were encountered: