-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Allow do concurrent inside cuf kernel directive #127693
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 all commits
fdeb3fa
17f277e
fa592f1
1ee5f69
4eaae62
809cebe
0182325
576b8b7
ba7eda3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
! RUN: bbc -emit-hlfir -fcuda %s -o - | FileCheck %s | ||
|
||
! Check if do concurrent works inside cuf kernel directive | ||
|
||
subroutine doconc1 | ||
integer :: i, n | ||
integer, managed :: a(3) | ||
a(:) = -1 | ||
n = 3 | ||
n = n - 1 | ||
!$cuf kernel do | ||
do concurrent(i=1:n) | ||
a(i) = 1 | ||
end do | ||
end | ||
|
||
! CHECK: func.func @_QPdoconc1() { | ||
! CHECK: %[[DECL:.*]]:2 = hlfir.declare %{{.*}}#0 {uniq_name = "_QFdoconc1Ei"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>) | ||
! CHECK: cuf.kernel<<<*, *>>> | ||
! CHECK: %{{.*}} = fir.load %[[DECL]]#0 : !fir.ref<i32> | ||
|
||
subroutine doconc2 | ||
integer :: i, j, m, n | ||
integer, managed :: a(2, 4) | ||
m = 2 | ||
n = 4 | ||
a(:,:) = -1 | ||
!$cuf kernel do | ||
do concurrent(i=1:m,j=1:n) | ||
a(i,j) = i+j | ||
end do | ||
end | ||
|
||
! CHECK: func.func @_QPdoconc2() { | ||
! CHECK: %[[DECLI:.*]]:2 = hlfir.declare %{{.*}}#0 {uniq_name = "_QFdoconc2Ei"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>) | ||
! CHECK: %[[DECLJ:.*]]:2 = hlfir.declare %{{.*}}#0 {uniq_name = "_QFdoconc2Ej"} : (!fir.ref<i32>) -> (!fir.ref<i32>, !fir.ref<i32>) | ||
! CHECK: cuf.kernel<<<*, *>>> (%arg0 : i32, %arg1 : i32) = (%{{.*}}, %{{.*}} : index, index) to (%{{.*}}, %{{.*}} : index, index) step (%{{.*}}, %{{.*}} : index, index) { | ||
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. Is this really the semantic of 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.
Yes, it's the same semantic with 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. Then only one range should be on the 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.
After discussion, we decide to keep all the range info in 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. Are we not setting the 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.
Correct. If it's omitted, it's one by default. |
||
! CHECK: %{{.*}} = fir.load %[[DECLI]]#0 : !fir.ref<i32> | ||
! CHECK: %{{.*}} = fir.load %[[DECLJ]]#0 : !fir.ref<i32> |
Uh oh!
There was an error while loading. Please reload this page.