-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[Flang][OpenMP] DISTRIBUTE PARALLEL DO lowering #106207
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
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
! This test checks lowering of OpenMP DISTRIBUTE PARALLEL DO composite | ||
! constructs. | ||
|
||
! RUN: bbc -fopenmp -emit-hlfir %s -o - | FileCheck %s | ||
! RUN: %flang_fc1 -fopenmp -emit-hlfir %s -o - | FileCheck %s | ||
|
||
! CHECK-LABEL: func.func @_QPdistribute_parallel_do_num_threads( | ||
subroutine distribute_parallel_do_num_threads() | ||
!$omp teams | ||
|
||
! CHECK: omp.parallel num_threads({{.*}}) private({{.*}}) { | ||
! CHECK: omp.distribute { | ||
! CHECK-NEXT: omp.wsloop { | ||
! CHECK-NEXT: omp.loop_nest | ||
!$omp distribute parallel do num_threads(10) | ||
do index_ = 1, 10 | ||
end do | ||
!$omp end distribute parallel do | ||
|
||
!$omp end teams | ||
end subroutine distribute_parallel_do_num_threads | ||
|
||
! CHECK-LABEL: func.func @_QPdistribute_parallel_do_dist_schedule( | ||
subroutine distribute_parallel_do_dist_schedule() | ||
!$omp teams | ||
|
||
! CHECK: omp.parallel private({{.*}}) { | ||
! CHECK: omp.distribute dist_schedule_static dist_schedule_chunk_size({{.*}}) { | ||
! CHECK-NEXT: omp.wsloop { | ||
! CHECK-NEXT: omp.loop_nest | ||
!$omp distribute parallel do dist_schedule(static, 4) | ||
do index_ = 1, 10 | ||
end do | ||
!$omp end distribute parallel do | ||
|
||
!$omp end teams | ||
end subroutine distribute_parallel_do_dist_schedule | ||
|
||
! CHECK-LABEL: func.func @_QPdistribute_parallel_do_ordered( | ||
subroutine distribute_parallel_do_ordered() | ||
!$omp teams | ||
|
||
! CHECK: omp.parallel private({{.*}}) { | ||
! CHECK: omp.distribute { | ||
! CHECK-NEXT: omp.wsloop ordered(1) { | ||
! CHECK-NEXT: omp.loop_nest | ||
!$omp distribute parallel do ordered(1) | ||
do index_ = 1, 10 | ||
end do | ||
!$omp end distribute parallel do | ||
|
||
!$omp end teams | ||
end subroutine distribute_parallel_do_ordered | ||
|
||
! CHECK-LABEL: func.func @_QPdistribute_parallel_do_private( | ||
subroutine distribute_parallel_do_private() | ||
! CHECK: %[[INDEX_ALLOC:.*]] = fir.alloca i32 | ||
! CHECK: %[[INDEX:.*]]:2 = hlfir.declare %[[INDEX_ALLOC]] | ||
! CHECK: %[[X_ALLOC:.*]] = fir.alloca i64 | ||
! CHECK: %[[X:.*]]:2 = hlfir.declare %[[X_ALLOC]] | ||
integer(8) :: x | ||
|
||
! CHECK: omp.teams { | ||
!$omp teams | ||
|
||
! CHECK: omp.parallel private(@{{.*}} %[[X]]#0 -> %[[X_ARG:.*]] : !fir.ref<i64>, | ||
! CHECK-SAME: @{{.*}} %[[INDEX]]#0 -> %[[INDEX_ARG:.*]] : !fir.ref<i32>) { | ||
! CHECK: %[[X_PRIV:.*]]:2 = hlfir.declare %[[X_ARG]] | ||
! CHECK: %[[INDEX_PRIV:.*]]:2 = hlfir.declare %[[INDEX_ARG]] | ||
! CHECK: omp.distribute { | ||
! CHECK-NEXT: omp.wsloop { | ||
! CHECK-NEXT: omp.loop_nest | ||
!$omp distribute parallel do private(x) | ||
do index_ = 1, 10 | ||
end do | ||
!$omp end distribute parallel do | ||
|
||
!$omp end teams | ||
end subroutine distribute_parallel_do_private |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.