-
Notifications
You must be signed in to change notification settings - Fork 14.8k
[flang][openmp] Changes for invoking scan Op #123254
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s | ||
|
||
subroutine inclusive_scan | ||
implicit none | ||
integer, parameter :: n = 100 | ||
integer a(n), b(n) | ||
integer x, k | ||
|
||
!CHECK: omp.wsloop reduction(mod: inscan, {{.*}}) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think it would be good to check that the block argument defined by the ! CHECK: omp.wsloop reduction(mod: inscan, %{{.*}} -> %[[RED_ARG:.*]] : {{.*}}) {
! CHECK: %[[RED_DECL:.*]]:2 = hlfir.declare %[[RED_ARG]]
! CHECK: omp.scan inclusive(%[[RED_DECL]]#0 : {{.*}}) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Updated to use the autogenerated checks so these gets checked There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd personally prefer not doing that, because it makes the test easily break for unrelated changes in representation and lowering. But feel free to leave it in if you prefer, I don't feel that strongly about it and there are a few other tests like this in the same directory. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I understand the issue you are pointing to. I have updated the testcase. |
||
!$omp parallel do reduction(inscan, +: x) | ||
do k = 1, n | ||
x = x + a(k) | ||
!CHECK: omp.scan inclusive({{.*}}) | ||
!$omp scan inclusive(x) | ||
b(k) = x | ||
end do | ||
end subroutine inclusive_scan | ||
|
||
|
||
subroutine exclusive_scan | ||
implicit none | ||
integer, parameter :: n = 100 | ||
integer a(n), b(n) | ||
integer x, k | ||
|
||
!CHECK: omp.wsloop reduction(mod: inscan, {{.*}}) { | ||
!$omp parallel do reduction(inscan, +: x) | ||
do k = 1, n | ||
x = x + a(k) | ||
!CHECK: omp.scan exclusive({{.*}}) | ||
!$omp scan exclusive(x) | ||
b(k) = x | ||
end do | ||
end subroutine exclusive_scan |
Uh oh!
There was an error while loading. Please reload this page.