File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed
llvm/include/llvm/Frontend/OpenACC Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -57,17 +57,17 @@ TYPE_PARSER("AUTO" >> construct<AccClause>(construct<AccClause::Auto>()) ||
57
57
parenthesized (Parser<AccObjectList>{}))) ||
58
58
" DEVICEPTR" >> construct<AccClause>(construct<AccClause::Deviceptr>(
59
59
parenthesized (Parser<AccObjectList>{}))) ||
60
- " DEVICENUM " >> construct<AccClause>(construct<AccClause::DeviceNum>(
61
- parenthesized (scalarIntConstantExpr ))) ||
60
+ " DEVICE_NUM " >> construct<AccClause>(construct<AccClause::DeviceNum>(
61
+ parenthesized (scalarIntExpr ))) ||
62
62
" DEVICE_RESIDENT" >>
63
63
construct<AccClause>(construct<AccClause::DeviceResident>(
64
64
parenthesized (Parser<AccObjectList>{}))) ||
65
65
(" DEVICE_TYPE" _tok || " DTYPE" _tok) >>
66
66
construct<AccClause>(construct<AccClause::DeviceType>(parenthesized(
67
- " *" >> construct<std::optional<std::list<Name >>>()))) ||
67
+ " *" >> construct<std::optional<std::list<ScalarIntExpr >>>()))) ||
68
68
(" DEVICE_TYPE" _tok || " DTYPE" _tok) >>
69
69
construct<AccClause>(construct<AccClause::DeviceType>(
70
- parenthesized (maybe(nonemptyList(name ))))) ||
70
+ parenthesized (maybe(nonemptyList(scalarIntExpr ))))) ||
71
71
" FINALIZE" >> construct<AccClause>(construct<AccClause::Finalize>()) ||
72
72
" FIRSTPRIVATE" >> construct<AccClause>(construct<AccClause::Firstprivate>(
73
73
parenthesized (Parser<AccObjectList>{}))) ||
Original file line number Diff line number Diff line change @@ -25,11 +25,21 @@ program openacc_clause_validity
25
25
real :: reduction_r
26
26
logical :: reduction_l
27
27
real (8 ), dimension (N, N) :: aa
28
+ logical :: ifCondition = .TRUE.
28
29
29
30
! ERROR: At least one clause is required on the DECLARE directive
30
31
! $acc declare
31
32
real (8 ), dimension (N) :: a
32
33
34
+ ! $acc init
35
+ ! $acc init if(.TRUE.)
36
+ ! $acc init if(ifCondition)
37
+ ! $acc init device_num(1)
38
+ ! $acc init device_num(i)
39
+ ! $acc init device_type(i)
40
+ ! $acc init device_type(2, i, j)
41
+ ! $acc init device_num(i) device_type(i, j) if(ifCondition)
42
+
33
43
! ERROR: At least one of ATTACH, COPYIN, CREATE clause must appear on the ENTER DATA directive
34
44
! $acc enter data
35
45
Original file line number Diff line number Diff line change @@ -106,7 +106,7 @@ def ACCC_Device : Clause<"device"> {
106
106
107
107
// 2.14.1
108
108
def ACCC_DeviceNum : Clause<"device_num"> {
109
- let flangClassValue = "ScalarIntConstantExpr ";
109
+ let flangClassValue = "ScalarIntExpr ";
110
110
}
111
111
112
112
// 2.7.3
@@ -121,7 +121,7 @@ def ACCC_DeviceResident : Clause<"device_resident"> {
121
121
122
122
// 2.4
123
123
def ACCC_DeviceType : Clause<"device_type"> {
124
- let flangClassValue = "Name ";
124
+ let flangClassValue = "ScalarIntExpr ";
125
125
let defaultValue = "*";
126
126
let isValueOptional = 1;
127
127
let isValueList = 1;
You can’t perform that action at this time.
0 commit comments