-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[flang][acc] Implement type categorization for FIR types (#126964)
The OpenACC type interfaces have been updated to require that a type self-identify which type category it belongs to. Ensure that FIR types are able to provide this self identification. In addition to implementing the new API, the PointerLikeType interface attachment was moved to FIROpenACCSupport library like MappableType to ensure all type interfaces and their implementation are now in the same spot.
- Loading branch information
1 parent
9456e7f
commit 7b473df
Showing
10 changed files
with
255 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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 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 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 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 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 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 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 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 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,49 @@ | ||
! RUN: bbc -fopenacc -emit-hlfir %s -o - | fir-opt -pass-pipeline='builtin.module(test-fir-openacc-interfaces)' --mlir-disable-threading 2>&1 | FileCheck %s | ||
|
||
program main | ||
real :: scalar | ||
real, allocatable :: scalaralloc | ||
type tt | ||
real :: field | ||
real :: fieldarray(10) | ||
end type tt | ||
type(tt) :: ttvar | ||
real :: arrayconstsize(10) | ||
real, allocatable :: arrayalloc(:) | ||
complex :: complexvar | ||
character*1 :: charvar | ||
|
||
!$acc enter data copyin(scalar, scalaralloc, ttvar, arrayconstsize, arrayalloc) | ||
!$acc enter data copyin(complexvar, charvar, ttvar%field, ttvar%fieldarray, arrayconstsize(1)) | ||
end program | ||
|
||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "scalar", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<f32> | ||
! CHECK: Type category: scalar | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "scalaralloc", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<!fir.box<!fir.heap<f32>>> | ||
! CHECK: Type category: nonscalar | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "ttvar", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<!fir.type<_QFTtt{field:f32,fieldarray:!fir.array<10xf32>}>> | ||
! CHECK: Type category: composite | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "arrayconstsize", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<!fir.array<10xf32>> | ||
! CHECK: Type category: array | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "arrayalloc", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<!fir.box<!fir.heap<!fir.array<?xf32>>>> | ||
! CHECK: Type category: array | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "complexvar", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<complex<f32>> | ||
! CHECK: Type category: scalar | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "charvar", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<!fir.char<1>> | ||
! CHECK: Type category: nonscalar | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "ttvar%field", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<f32> | ||
! CHECK: Type category: composite | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "ttvar%fieldarray", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<!fir.array<10xf32>> | ||
! CHECK: Type category: array | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "arrayconstsize(1)", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<!fir.array<10xf32>> | ||
! CHECK: Type category: array |
Oops, something went wrong.