Skip to content

[Flang-RT] Make __cuda_builtins dependency explicit - #205895

Merged
Meinersbur merged 1 commit into
llvm:mainfrom
Meinersbur:flangrt_cuda-builtins-implicit-dep
Jun 25, 2026
Merged

[Flang-RT] Make __cuda_builtins dependency explicit#205895
Meinersbur merged 1 commit into
llvm:mainfrom
Meinersbur:flangrt_cuda-builtins-implicit-dep

Conversation

@Meinersbur

@Meinersbur Meinersbur commented Jun 25, 2026

Copy link
Copy Markdown
Member

When compiling CUDA-Fortran, a use of the module __cuda_builtins is added implicitly by the compiler. Add explicit use so CMake can consider it in the built order. The other modules that are compiled with CUDA enabled (cudadevice.f90 and cooperativegroups.f90) transitively depend on depend on __cuda_builtins as well.

Fixes the flang-aarch64-rel-assert buildbot.

@Meinersbur
Meinersbur requested a review from kkwli June 25, 2026 19:33
@Meinersbur
Meinersbur marked this pull request as ready for review June 25, 2026 19:41
@Meinersbur
Meinersbur requested a review from clementval June 25, 2026 19:41
@Meinersbur
Meinersbur merged commit 0b328bc into llvm:main Jun 25, 2026
15 checks passed
@kkwli

kkwli commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for the quick fix. It works in my local build.

@kparzysz

kparzysz commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

This breaks check-flang, e.g. in #205904

Failed Tests (1):
  Flang :: Semantics/cuf05.cuf

PR with a fix: #205914

maarcosrmz pushed a commit to maarcosrmz/llvm-project that referenced this pull request Jul 1, 2026
When compiling CUDA-Fortran, a use of the module __cuda_builtins is
added implicitly by the compiler. Add explicit use so CMake can consider
it in the built order. The other modules that are compiled with CUDA
enabled (`cudadevice.f90` and `cooperativegroups.f90`) transitively
depend on depend on __cuda_builtins as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants