Skip to content

[OpenMP][Fix] libomptarget Fortran tests #74543

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

Merged
merged 2 commits into from
Dec 19, 2023
Merged

Conversation

fabianmcg
Copy link
Contributor

@fabianmcg fabianmcg commented Dec 6, 2023

This patch fixes the erroneous multiple-target requirement in Fortran offloading tests. Additionally, it adds two new variables (test_flags_clang, test_flags_flang) to lit.cfg so that compiler-specific flags for Clang and Flang can be specified.

This patch fixes the erroneous multiple-target requirement in Fortran offloading
tests. Additionally, it adds two new variables (`test_flags_clang`, `test_flags_flang`)
to `lt.cfg` so that compiler-specific flags for Clang and Flang can be specified.
@fabianmcg fabianmcg marked this pull request as ready for review December 6, 2023 01:08
@llvmbot llvmbot added the openmp:libomptarget OpenMP offload runtime label Dec 6, 2023
@@ -2,8 +2,7 @@
! that checks constant indexing on device
! correctly works (regression test for prior
! bug).
! REQUIRES: flang, amdgcn-amd-amdhsa
! UNSUPPORTED: nvptx64-nvidia-cuda
! REQUIRES: flang
! UNSUPPORTED: nvptx64-nvidia-cuda-LTO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is nvptx still unsupported?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the restriction that test is supported.

However, there are a couple of tests that are still unsupported like target_map_common_block2.f90. The reason is that nvlink fails to resolve some external symbols (bc of the inclusion of omp_lib), but those symbols shouldn't have been inserted into the module in the first place.

@fabianmcg fabianmcg requested a review from jdoerfert December 11, 2023 19:31
@@ -136,7 +140,7 @@ else: # Unices
if config.cuda_libdir:
config.test_flags += " -Wl,-rpath," + config.cuda_libdir
if config.libomptarget_current_target.startswith('nvptx'):
config.test_flags += " --libomptarget-nvptx-bc-path=" + config.library_dir + '/DeviceRTL'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the leading whitespace needs to stay in case config.test_flags_clang is not empty.

Copy link
Contributor

@shiltian shiltian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@jdoerfert jdoerfert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LG, the cuda test support can be a follow up.

@fabianmcg fabianmcg merged commit 49efb08 into llvm:main Dec 19, 2023
@jplehr
Copy link
Contributor

jplehr commented Dec 19, 2023

This patch seems to have made the AMDGPU OpenMP Offload buildbot unhappy (https://lab.llvm.org/buildbot/#/builders/193/builds/44036).

If you need help in recreating the issue, let me know.

@fabianmcg
Copy link
Contributor Author

I've just reverted, I'll investigate the issue offline and try to replicate.

jdoerfert pushed a commit that referenced this pull request Dec 21, 2023
This patch fixes the erroneous multiple-target requirement in Fortran
offloading tests. Additionally, it adds two new variables
(test_flags_clang, test_flags_flang) to lit.cfg so that
compiler-specific flags for Clang and Flang can be specified.

This patch re-lands: #74543. The error was caused by having:
```
config.substitutions.append(("%flags", config.test_flags))
config.substitutions.append(("%flags_clang", config.test_flags_clang))
config.substitutions.append(("%flags_flang", config.test_flags_flang))
```
when instead it has to be:
```
config.substitutions.append(("%flags_clang", config.test_flags_clang))
config.substitutions.append(("%flags_flang", config.test_flags_flang))
config.substitutions.append(("%flags", config.test_flags))
```
because LIT replaces with the first longest sub-string match.
@fabianmcg fabianmcg deleted the omp_fix branch December 21, 2023 22:28
qihangkong pushed a commit to rvgpu/rvgpu-llvm that referenced this pull request Apr 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomptarget OpenMP offload runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants