-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[OpenMP] Add num_threads clause list format and strict modifier support #85466
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
Conversation
Add support to the runtime for 6.0 spec features that allow num_threads clause to take a list, and also make use of the strict modifier. Provides new compiler interface functions for these features.
Can we have tests? |
✅ With the latest revision this PR passed the C/C++ code formatter. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Will the front end support be upstreamed as well?
@@ -1268,6 +1268,11 @@ kmp_set_disp_num_buffers 890 | |||
__kmpc_atomic_val_8_cas_cpt 2158 | |||
%endif | |||
|
|||
# No longer need to put ordinal numbers |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will not cause issue on Windows anymore?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, you can add exported symbols just by name now. Older symbols keep their ordinal number.
to the parallel region on which the clause was specified.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This change causes failed tests on i386: https://github.com/mstorsjo/llvm-mingw/actions/runs/9654575386/job/26643787120
I presume the test spawns a very large number of threads? Can it be marked with |
Yes, in the second to last case, the test uses a pretty deep level of nesting, and tests the num_threads clause list at two different nesting levels, so it will generate a lot of threads. We could modify the test so that the list used at the outer level is something like 3,1 and inner level is 3,1, which should create 9 threads at most. That should be adequate to show the feature is working correctly. Would that work for this system? |
I'm pretty sure that 9 threads should be quite doable to spawn. If you put up a PR to do this modification, I might be able to test it. |
Ping - can you post the change (or provide a link to it?) for reducing the number of threads here, to get the tests back to passing again? |
Working on it. |
Martin, will it work with 36 threads? I have a pull request for that change up now. Using 1 in the outer level list has exposed what appears to be a non-trivial bug. I'll work on that and add the triggering test case when fixed. Let me know if the 36 threads case will work for you for now. Thanks! |
…rt (llvm#85466) Add support to the runtime for 6.0 spec features that allow num_threads clause to take a list, and also make use of the strict modifier. Provides new compiler interface functions for these features.
Add support to the runtime for 6.0 spec features that allow num_threads clause to take a list, and also make use of the strict modifier. Provides new compiler interface functions for these features.