Skip to content

Commit c69efcd

Browse files
authored
[flang][cuda] Relax assumed size check on object with device attribute (#89466)
Assumed size arrays are apparently allowed with attribute device.
1 parent f433c3b commit c69efcd

File tree

2 files changed

+1
-7
lines changed

2 files changed

+1
-7
lines changed

flang/lib/Semantics/check-declarations.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -948,11 +948,6 @@ void CheckHelper::CheckObjectEntity(
948948
"Component '%s' with ATTRIBUTES(DEVICE) must also be allocatable"_err_en_US,
949949
symbol.name());
950950
}
951-
if (IsAssumedSizeArray(symbol)) {
952-
messages_.Say(
953-
"Object '%s' with ATTRIBUTES(DEVICE) may not be assumed size"_err_en_US,
954-
symbol.name());
955-
}
956951
break;
957952
case common::CUDADataAttr::Managed:
958953
if (!IsAutomatic(symbol) && !IsAllocatable(symbol) &&

flang/test/Semantics/cuf03.cuf

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ module m
5757
contains
5858
attributes(device) subroutine devsubr(n,da)
5959
integer, intent(in) :: n
60-
!ERROR: Object 'da' with ATTRIBUTES(DEVICE) may not be assumed size
61-
real, device :: da(*)
60+
real, device :: da(*) ! ok
6261
real, managed :: ma(n) ! ok
6362
!WARNING: Pointer 'dp' may not be associated in a device subprogram
6463
real, device, pointer :: dp

0 commit comments

Comments
 (0)