Repository navigation
[flang-rt][cuda] Fix the aarch64 build of the runtime with CUDA 12.0 - #239488
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On aarch64, glibc's
<fpu_control.h>defines_FPU_GETCWand_FPU_SETCWas
__builtin_aarch64_get_fpcr()and__builtin_aarch64_set_fpcr()when thecompiler reports GCC 6 or later. nvcc 12.0 reports the host GCC version but
does not recognize these builtins, so building flang-rt with
FLANG_RT_EXPERIMENTAL_OFFLOAD_SUPPORT=CUDAfails on aarch64:flang-rt/lib/runtime/exceptions.cpp(205): error: identifier "__builtin_aarch64_get_fpcr" is undefined
flang-rt/lib/runtime/exceptions.cpp(216): error: identifier "__builtin_aarch64_get_fpcr" is undefined
flang-rt/lib/runtime/exceptions.cpp(222): error: identifier "__builtin_aarch64_set_fpcr" is undefined
With nvcc 12.0 on aarch64, read and write FPCR with
mrs/msrinlineassembly, which is what glibc itself uses for compilers older than GCC 6.
Other compilers and CUDA versions keep using
_FPU_GETCW/_FPU_SETCWunchanged.