Skip to content

Commit

Permalink
[flang][cuda][NFC] Add more descriptor inquiry tests for data transfer (
Browse files Browse the repository at this point in the history
#108094)

Make sure there is no data transfer generated when a device variable is
used in these intrinsic functions.
  • Loading branch information
clementval authored Sep 19, 2024
1 parent 0f06f70 commit 5e1a54b
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions flang/test/Lower/CUDA/cuda-data-transfer.cuf
Original file line number Diff line number Diff line change
Expand Up @@ -354,12 +354,23 @@ end subroutine
! CHECK: cuf.kernel<<<*, *>>>
! CHECK-NOT: cuf.data_transfer

subroutine sub18()
subroutine sub18(o)
integer, device, optional, allocatable :: o(:)
integer, device, allocatable :: a(:)
integer :: isz

isz = size(a)
integer, device, pointer :: p(:)
integer :: b
integer :: s(1)
logical :: l

b = size(a)
b = lbound(a, dim=1)
b = ubound(a, dim=1)
s = shape(a)
l = allocated(a)
l = associated(p)
b = kind(a)
l = present(o)
end subroutine

! CHECK-LABEL: func.func @_QPsub18()
! CHECK-LABEL: func.func @_QPsub18
! CHECK-NOT: cuf.data_transfer

0 comments on commit 5e1a54b

Please sign in to comment.