File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -953,7 +953,14 @@ void AccAttributeVisitor::Post(
953
953
const auto &clauseList = std::get<parser::AccClauseList>(x.t );
954
954
for (const auto &clause : clauseList.v ) {
955
955
// Restriction - line 2414
956
- DoNotAllowAssumedSizedArray (GetAccObjectList (clause));
956
+ // We assume the restriction is present because clauses that require
957
+ // moving data would require the size of the data to be present, but
958
+ // the deviceptr and present clauses do not require moving data and
959
+ // thus we permit them.
960
+ if (!std::holds_alternative<parser::AccClause::Deviceptr>(clause.u ) &&
961
+ !std::holds_alternative<parser::AccClause::Present>(clause.u )) {
962
+ DoNotAllowAssumedSizedArray (GetAccObjectList (clause));
963
+ }
957
964
}
958
965
}
959
966
Original file line number Diff line number Diff line change @@ -62,9 +62,21 @@ end function fct1
62
62
subroutine sub2 (cc )
63
63
real (8 ), dimension (* ) :: cc
64
64
! ERROR: Assumed-size dummy arrays may not appear on the DECLARE directive
65
- ! $acc declare present (cc)
65
+ ! $acc declare copyin (cc)
66
66
end subroutine sub2
67
67
68
+ subroutine sub2e1 (cc )
69
+ real (8 ), dimension (* ) :: cc
70
+ ! OK
71
+ ! $acc declare present(cc)
72
+ end subroutine sub2e1
73
+
74
+ subroutine sub2e2 (cc )
75
+ real (8 ), dimension (* ) :: cc
76
+ ! OK
77
+ ! $acc declare deviceptr(cc)
78
+ end subroutine sub2e2
79
+
68
80
subroutine sub3 ()
69
81
real :: aa(100 )
70
82
! ERROR: The ZERO modifier is not allowed for the COPYOUT clause on the DECLARE directive
You can’t perform that action at this time.
0 commit comments