forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 55
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]: Better preprocessor macros to detect RDNA/CDNA family at compile time #59
Comments
yxsamliu
added a commit
to yxsamliu/llvm-project
that referenced
this issue
Apr 10, 2024
If a processor belongs to CDNA generation, pre-define macro `__AMDGCN_CDNA_VERSION__` as an integer. Fixes: ROCm#59
There are some concerns about introducing a macro for CDNA version. Using #if __has_builtin may be a better way to determine whether a feature is available (https://clang.llvm.org/docs/LanguageExtensions.html#feature-checking-macros). It works for all GPUs, even for future generations. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Suggestion Description
As new instructions/features are added with each new arch, it is useful to know the target architecture at compile time to employ separate code paths. For example: FP64 MFMA was added in CDNA2, so CDNA2 and later can use one code path while CDNA1 uses a different code path.
It gets tedious because all the archs need to be enumerated, and code needs to be updated as new archs become available:
It would be nice if we had something like:
This would mirror the way it is done in CUDA:
Operating System
No response
GPU
No response
ROCm Component
No response
The text was updated successfully, but these errors were encountered: