[flang-commits] [flang] 5e1a54b - [flang][cuda][NFC] Add more descriptor inquiry tests for data transfer (#108094)
via flang-commits
flang-commits at lists.llvm.org
Wed Sep 18 21:45:36 PDT 2024
Author: Valentin Clement (バレンタイン クレメン)
Date: 2024-09-18T21:45:32-07:00
New Revision: 5e1a54b298d108be9c2face5ca0e6664c2dafc93
URL: https://github.com/llvm/llvm-project/commit/5e1a54b298d108be9c2face5ca0e6664c2dafc93
DIFF: https://github.com/llvm/llvm-project/commit/5e1a54b298d108be9c2face5ca0e6664c2dafc93.diff
LOG: [flang][cuda][NFC] Add more descriptor inquiry tests for data transfer (#108094)
Make sure there is no data transfer generated when a device variable is
used in these intrinsic functions.
Added:
Modified:
flang/test/Lower/CUDA/cuda-data-transfer.cuf
Removed:
################################################################################
diff --git a/flang/test/Lower/CUDA/cuda-data-transfer.cuf b/flang/test/Lower/CUDA/cuda-data-transfer.cuf
index 11f1f33d7cb587..2f76b5e78800ad 100644
--- a/flang/test/Lower/CUDA/cuda-data-transfer.cuf
+++ b/flang/test/Lower/CUDA/cuda-data-transfer.cuf
@@ -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
More information about the flang-commits
mailing list