-
Notifications
You must be signed in to change notification settings - Fork 74
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
Rework BOOST_COMP_HIP
and BOOST_LANG_HIP
#1974
Conversation
There is already |
From what I understand that is used to detect if we are compiling a HIP file while |
As @fwyzard pointed out the VERSION numbers have strange behaviour, please see an older discussion #1914 (comment) |
Okay. I think a lot of (my) confusion comes from the different behaviour between CUDA and HIP:
My suggestion: Get rid of |
BOOST_COMP_HIP
BOOST_COMP_HIP
and BOOST_LANG_HIP
// HIP defines "abort()" as "{asm("trap;");}", which breaks some kernels | ||
# undef abort |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was problematic when we targeted CUDA devices through HIP. Since we no longer do this we can remove this.
# if defined(BOOST_LANG_CUDA) && BOOST_LANG_CUDA | ||
# undef BOOST_LANG_CUDA | ||
# define BOOST_LANG_CUDA BOOST_VERSION_NUMBER_NOT_AVAILABLE | ||
# endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above.
# if defined(__HIPCC__) // We are using a HIP-capable compiler; could be hcc, hip-clang or nvcc | ||
# include <hip/hip_version.h> | ||
// HIP doesn't give us a patch level for the last entry, just a gitdate | ||
# define BOOST_COMP_HIP BOOST_VERSION_NUMBER(HIP_VERSION_MAJOR, HIP_VERSION_MINOR, 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Essentially, BOOST_COMP_HIP
and BOOST_LANG_HIP
do the same thing since there is no special HIP language we could test for. If we use a HIP-capable compiler we assume everything it touches is a "HIP source file".
4dcb3ee
to
8971e1e
Compare
c9c25e8
to
d4a5964
Compare
// https://github.com/ROCm-Developer-Tools/HIP/blob/master/docs/markdown/hip_porting_guide.md#compiler-defines-summary | ||
#if !defined(BOOST_LANG_HIP) | ||
# if defined(__HIPCC__) && (defined(__CUDACC__) || defined(__HIP__)) | ||
# include <hip/hip_runtime.h> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was actually the reason for the CI failures. __forceinline__
is not a HIP keyword but defined somewhere in the header files included by hip_runtime.h
.
@psychocoderHPC Ping! |
Currently
BOOST_COMP_HIP
can only detect whether we are compiling with clang targeting HIP. This PR adds a version detection so we can have checks like these:#if BOOST_COMP_HIP >= BOOST_VERSION_NUMBER(5, 5, 0)