Skip to content

[OpenMP] runtime support for efficient partitioning of collapsed triangular loops #83939

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
Mar 8, 2024

Conversation

vadikp-intel
Copy link
Contributor

@vadikp-intel vadikp-intel commented Mar 5, 2024

This PR adds OMP runtime support for more efficient partitioning of certain types of collapsed loops that can be used by compilers that support loop collapsing (i.e. MSVC) to achieve more optimal thread load balancing.

In particular, this PR addresses double nested upper and lower isosceles triangular loops of the following types

  1. lower triangular 'less_than'
    for (int i=0; i<N; i++)
    for (int j=0; j<i; j++)
  2. lower triangular 'less_than_equal'
    for (int i=0; i<N; j++)
    for (int j=0; j<=i; j++)
  3. upper triangular
    for (int i=0; i<N; i++)
    for (int j=i; j<N; j++)

Includes tests for the three supported loop types.

@llvmbot llvmbot added the openmp:libomp OpenMP host runtime label Mar 5, 2024
@vadikp-intel vadikp-intel self-assigned this Mar 5, 2024
@vadikp-intel vadikp-intel requested review from natgla and jpeyton52 March 5, 2024 01:48
@vadikp-intel vadikp-intel changed the title OMP runtime support for efficient partitioning of collapsed triangular loops [OpenMP] runtime support for efficient partitioning of collapsed triangular loops Mar 6, 2024
@natgla
Copy link
Contributor

natgla commented Mar 8, 2024

looks good to me

Copy link
Contributor

@natgla natgla left a comment

Choose a reason for hiding this comment

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

lgtm

@vadikp-intel vadikp-intel merged commit fcd2d48 into main Mar 8, 2024
@vadikp-intel vadikp-intel deleted the users/vadikp/triangular.loops branch March 8, 2024 00:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
openmp:libomp OpenMP host runtime
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants