This is an archive of the discontinued LLVM Phabricator instance.

[libomptarget-nvptx] Add testing infrastructure
ClosedPublic

Authored by Hahnfeld on Sep 5 2018, 8:12 AM.

Details

Summary

This patch also introduces testing for libomptarget-nvptx
which has been missing until now. I propose to add tests for
all bugs that are fixed in the future.
The target check-libomptarget-nvptx is not run by default because

  • we can't determine if there is a GPU plugged into the system.
  • it will require the latest Clang compiler. Keeping compatibility with older releases would prevent testing newer code generation developed in trunk.

Diff Detail

Repository
rL LLVM

Event Timeline

Hahnfeld created this revision.Sep 5 2018, 8:12 AM
Hahnfeld added inline comments.Sep 5 2018, 8:17 AM
libomptarget/deviceRTLs/nvptx/src/parallel.cu
214–223 ↗(On Diff #164048)

I'm not really sure why this is needed. It was added in https://github.com/clang-ykt/openmp/commit/588e8cbc751299c9f40067dc4d36812e8e49d2bd#diff-6fa63679541dd3fa12162559c1aeac42R279 and I can't find a technical explanation. Because I can't test on Volta (only Pascal) I've copied the code for now, but it would be great to know the background and add an explanation.

Hahnfeld updated this revision to Diff 164401.Sep 7 2018, 6:29 AM
Hahnfeld retitled this revision from [libomptarget][NVPTX] Fix number of threads in parallel to [libomptarget-nvptx] Add testing infrastructure.
Hahnfeld edited the summary of this revision. (Show Details)

Split testing infrastructure from bugfix.

Great job, adding testing infrastructure has been on our list for a long time!

I don't have any comments, just waiting for the --libomptarget-nvptx-path flag to be accepted into the clang driver. Then we can have a look at the rest of this stack.

Considering your comment in the description about requiring latest Clang perhaps you should revisit this patch: D46842

Considering your comment in the description about requiring latest Clang perhaps you should revisit this patch: D46842

D46842 only helps if the OpenMP runtime is not built stand-alone.
For the OpenMP runtime tests, we take care that the tests also work with other compatible compilers, and also with older versions.

We might configure different behavior for stand-alone and in-llvm-tree builts.
Considering the necessity of a GPU supporting the features, it makes sense to have a separate target for these tests and executing them manually.

Considering your comment in the description about requiring latest Clang perhaps you should revisit this patch: D46842

In my opinion the two matters are different with regard to an important detail:

  1. The linked change in D46842 is about building libomptarget-nvptx with in-tree Clang. As a result the build system would recompile the library whenever there is a change in the Clang sources. For me this drawback outweights the potential gain; in particular you can build the bclib with Clang 7.0 and it will still be inlined when building an application with a later version of Clang (e.g. current trunk), so I don't see the need to use in-tree Clang.
  2. This patch adds testing infrastructure which will kick in after libomptarget-nvptx has already been built. At the moment the tests will only work with the latest Clang because it relies on --libomptarget-nvptx-path and code generation that is not yet included in a released version of LLVM. Incidentally I'm listing this as one of the reasons why check-libomptarget-nvptx is not included in neither check-all nor check-openmp. (However I think "we can't determine if there is a GPU plugged into the system" is the one that really matters and we'll probably never be able to solve this, so I don't see enabling these tests by default anyway.)

I hope this clarifies my thoughts that I've brought up in some review threads. From my point of view there is no contradiction to what I propose in this patch and for me the choice of not enabling the tests by default is the logical consequence of my previous statements.

I don't have any comments, just waiting for the --libomptarget-nvptx-path flag to be accepted into the clang driver. Then we can have a look at the rest of this stack.

Ping, I landed the Clang patch yesterday.

grokos accepted this revision.Sep 28 2018, 6:38 AM

Then this revision is good to go!

This revision is now accepted and ready to land.Sep 28 2018, 6:38 AM
This revision was automatically updated to reflect the committed changes.