Skip to content

Commit ff24e9a

Browse files
committed
[OpenACC] Implement 'default_async' sema
A fairly simple one, only valid on the 'set' construct, this clause takes an int expression. Most of the work was already done as a part of parsing, so this patch ends up being a lot of infrastructure.
1 parent 21c785d commit ff24e9a

21 files changed

+153
-52
lines changed

clang/include/clang/AST/OpenACCClause.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -633,6 +633,19 @@ class OpenACCDeviceNumClause : public OpenACCClauseWithSingleIntExpr {
633633
SourceLocation EndLoc);
634634
};
635635

636+
class OpenACCDefaultAsyncClause : public OpenACCClauseWithSingleIntExpr {
637+
OpenACCDefaultAsyncClause(SourceLocation BeginLoc, SourceLocation LParenLoc,
638+
Expr *IntExpr, SourceLocation EndLoc);
639+
640+
public:
641+
static bool classof(const OpenACCClause *C) {
642+
return C->getClauseKind() == OpenACCClauseKind::DefaultAsync;
643+
}
644+
static OpenACCDefaultAsyncClause *
645+
Create(const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
646+
Expr *IntExpr, SourceLocation EndLoc);
647+
};
648+
636649
/// Represents a 'collapse' clause on a 'loop' construct. This clause takes an
637650
/// integer constant expression 'N' that represents how deep to collapse the
638651
/// construct. It also takes an optional 'force' tag that permits intervening

clang/include/clang/Basic/OpenACCClauses.def

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ VISIT_CLAUSE(Create)
3838
CLAUSE_ALIAS(PCreate, Create, true)
3939
CLAUSE_ALIAS(PresentOrCreate, Create, true)
4040
VISIT_CLAUSE(Default)
41+
VISIT_CLAUSE(DefaultAsync)
4142
VISIT_CLAUSE(Delete)
4243
VISIT_CLAUSE(Detach)
4344
VISIT_CLAUSE(DeviceNum)

clang/include/clang/Sema/SemaOpenACC.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,7 @@ class SemaOpenACC : public SemaBase {
297297
ClauseKind == OpenACCClauseKind::NumWorkers ||
298298
ClauseKind == OpenACCClauseKind::Async ||
299299
ClauseKind == OpenACCClauseKind::DeviceNum ||
300+
ClauseKind == OpenACCClauseKind::DefaultAsync ||
300301
ClauseKind == OpenACCClauseKind::Tile ||
301302
ClauseKind == OpenACCClauseKind::Worker ||
302303
ClauseKind == OpenACCClauseKind::Vector ||
@@ -349,6 +350,7 @@ class SemaOpenACC : public SemaBase {
349350
ClauseKind == OpenACCClauseKind::NumWorkers ||
350351
ClauseKind == OpenACCClauseKind::Async ||
351352
ClauseKind == OpenACCClauseKind::DeviceNum ||
353+
ClauseKind == OpenACCClauseKind::DefaultAsync ||
352354
ClauseKind == OpenACCClauseKind::Tile ||
353355
ClauseKind == OpenACCClauseKind::Gang ||
354356
ClauseKind == OpenACCClauseKind::Worker ||
@@ -486,6 +488,7 @@ class SemaOpenACC : public SemaBase {
486488
ClauseKind == OpenACCClauseKind::NumWorkers ||
487489
ClauseKind == OpenACCClauseKind::Async ||
488490
ClauseKind == OpenACCClauseKind::DeviceNum ||
491+
ClauseKind == OpenACCClauseKind::DefaultAsync ||
489492
ClauseKind == OpenACCClauseKind::Tile ||
490493
ClauseKind == OpenACCClauseKind::Worker ||
491494
ClauseKind == OpenACCClauseKind::Vector ||
@@ -498,6 +501,7 @@ class SemaOpenACC : public SemaBase {
498501
ClauseKind == OpenACCClauseKind::NumWorkers ||
499502
ClauseKind == OpenACCClauseKind::Async ||
500503
ClauseKind == OpenACCClauseKind::DeviceNum ||
504+
ClauseKind == OpenACCClauseKind::DefaultAsync ||
501505
ClauseKind == OpenACCClauseKind::Tile ||
502506
ClauseKind == OpenACCClauseKind::Worker ||
503507
ClauseKind == OpenACCClauseKind::Vector ||

clang/lib/AST/OpenACCClause.cpp

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ bool OpenACCClauseWithSingleIntExpr::classof(const OpenACCClause *C) {
4747
return OpenACCNumWorkersClause::classof(C) ||
4848
OpenACCVectorLengthClause::classof(C) ||
4949
OpenACCDeviceNumClause::classof(C) ||
50+
OpenACCDefaultAsyncClause::classof(C) ||
5051
OpenACCVectorClause::classof(C) || OpenACCWorkerClause::classof(C) ||
5152
OpenACCCollapseClause::classof(C) || OpenACCAsyncClause::classof(C);
5253
}
@@ -239,6 +240,27 @@ OpenACCDeviceNumClause *OpenACCDeviceNumClause::Create(const ASTContext &C,
239240
return new (Mem) OpenACCDeviceNumClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
240241
}
241242

243+
OpenACCDefaultAsyncClause::OpenACCDefaultAsyncClause(SourceLocation BeginLoc,
244+
SourceLocation LParenLoc,
245+
Expr *IntExpr,
246+
SourceLocation EndLoc)
247+
: OpenACCClauseWithSingleIntExpr(OpenACCClauseKind::DefaultAsync, BeginLoc,
248+
LParenLoc, IntExpr, EndLoc) {
249+
assert((IntExpr->isInstantiationDependent() ||
250+
IntExpr->getType()->isIntegerType()) &&
251+
"default_async expression type not scalar/dependent");
252+
}
253+
254+
OpenACCDefaultAsyncClause *
255+
OpenACCDefaultAsyncClause::Create(const ASTContext &C, SourceLocation BeginLoc,
256+
SourceLocation LParenLoc, Expr *IntExpr,
257+
SourceLocation EndLoc) {
258+
void *Mem = C.Allocate(sizeof(OpenACCDefaultAsyncClause),
259+
alignof(OpenACCDefaultAsyncClause));
260+
return new (Mem)
261+
OpenACCDefaultAsyncClause(BeginLoc, LParenLoc, IntExpr, EndLoc);
262+
}
263+
242264
OpenACCWaitClause *OpenACCWaitClause::Create(
243265
const ASTContext &C, SourceLocation BeginLoc, SourceLocation LParenLoc,
244266
Expr *DevNumExpr, SourceLocation QueuesLoc, ArrayRef<Expr *> QueueIdExprs,
@@ -575,6 +597,13 @@ void OpenACCClausePrinter::VisitDeviceNumClause(
575597
OS << ")";
576598
}
577599

600+
void OpenACCClausePrinter::VisitDefaultAsyncClause(
601+
const OpenACCDefaultAsyncClause &C) {
602+
OS << "default_async(";
603+
printExpr(C.getIntExpr());
604+
OS << ")";
605+
}
606+
578607
void OpenACCClausePrinter::VisitAsyncClause(const OpenACCAsyncClause &C) {
579608
OS << "async";
580609
if (C.hasIntExpr()) {

clang/lib/AST/StmtProfile.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2650,6 +2650,11 @@ void OpenACCClauseProfiler::VisitDeviceNumClause(
26502650
Profiler.VisitStmt(Clause.getIntExpr());
26512651
}
26522652

2653+
void OpenACCClauseProfiler::VisitDefaultAsyncClause(
2654+
const OpenACCDefaultAsyncClause &Clause) {
2655+
Profiler.VisitStmt(Clause.getIntExpr());
2656+
}
2657+
26532658
void OpenACCClauseProfiler::VisitWorkerClause(
26542659
const OpenACCWorkerClause &Clause) {
26552660
if (Clause.hasIntExpr())

clang/lib/AST/TextNodeDumper.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ void TextNodeDumper::Visit(const OpenACCClause *C) {
414414
case OpenACCClauseKind::Detach:
415415
case OpenACCClauseKind::Delete:
416416
case OpenACCClauseKind::DeviceNum:
417+
case OpenACCClauseKind::DefaultAsync:
417418
case OpenACCClauseKind::DevicePtr:
418419
case OpenACCClauseKind::Finalize:
419420
case OpenACCClauseKind::FirstPrivate:

clang/lib/Parse/ParseOpenACC.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,13 +1082,7 @@ Parser::OpenACCClauseParseResult Parser::ParseOpenACCClauseParams(
10821082
return OpenACCCanContinue();
10831083
}
10841084

1085-
// TODO OpenACC: as we implement the 'rest' of the above, this 'if' should
1086-
// be removed leaving just the 'setIntExprDetails'.
1087-
if (ClauseKind == OpenACCClauseKind::NumWorkers ||
1088-
ClauseKind == OpenACCClauseKind::DeviceNum ||
1089-
ClauseKind == OpenACCClauseKind::VectorLength)
1090-
ParsedClause.setIntExprDetails(IntExpr.get());
1091-
1085+
ParsedClause.setIntExprDetails(IntExpr.get());
10921086
break;
10931087
}
10941088
case OpenACCClauseKind::DType:

clang/lib/Sema/SemaOpenACC.cpp

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,14 @@ bool doesClauseApplyToDirective(OpenACCDirectiveKind DirectiveKind,
463463
return false;
464464
}
465465
}
466+
case OpenACCClauseKind::DefaultAsync: {
467+
switch (DirectiveKind) {
468+
case OpenACCDirectiveKind::Set:
469+
return true;
470+
default:
471+
return false;
472+
}
473+
}
466474
}
467475

468476
default:
@@ -977,6 +985,20 @@ OpenACCClause *SemaOpenACCClauseVisitor::VisitDeviceNumClause(
977985
Clause.getEndLoc());
978986
}
979987

988+
OpenACCClause *SemaOpenACCClauseVisitor::VisitDefaultAsyncClause(
989+
SemaOpenACC::OpenACCParsedClause &Clause) {
990+
// OpenACC 3.3 2.14.3: Two instances of the same clause may not appear on the
991+
// same directive.
992+
if (checkAlreadyHasClauseOfKind(SemaRef, ExistingClauses, Clause))
993+
return nullptr;
994+
995+
assert(Clause.getNumIntExprs() == 1 &&
996+
"Invalid number of expressions for default_async");
997+
return OpenACCDefaultAsyncClause::Create(
998+
Ctx, Clause.getBeginLoc(), Clause.getLParenLoc(), Clause.getIntExprs()[0],
999+
Clause.getEndLoc());
1000+
}
1001+
9801002
OpenACCClause *SemaOpenACCClauseVisitor::VisitPrivateClause(
9811003
SemaOpenACC::OpenACCParsedClause &Clause) {
9821004
// ActOnVar ensured that everything is a valid variable reference, so there
@@ -3681,12 +3703,9 @@ bool SemaOpenACC::ActOnStartStmtDirective(
36813703
if (K == OpenACCDirectiveKind::Set &&
36823704
llvm::find_if(
36833705
Clauses,
3684-
llvm::IsaPred</*OpenACCDefaultAsyncClause,*/ // TODO: ERICH Need to
3685-
// implement.
3686-
// DefaultAsyncClause
3687-
// then enable this.
3688-
OpenACCDeviceNumClause, OpenACCDeviceTypeClause,
3689-
OpenACCIfClause>) == Clauses.end())
3706+
llvm::IsaPred<OpenACCDefaultAsyncClause, OpenACCDeviceNumClause,
3707+
OpenACCDeviceTypeClause, OpenACCIfClause>) ==
3708+
Clauses.end())
36903709
return Diag(StartLoc, diag::err_acc_construct_one_clause_of)
36913710
<< K
36923711
<< GetListOfClauses({OpenACCClauseKind::DefaultAsync,

clang/lib/Sema/TreeTransform.h

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11909,6 +11909,29 @@ void OpenACCClauseTransform<Derived>::VisitDeviceNumClause (
1190911909
ParsedClause.getEndLoc());
1191011910
}
1191111911

11912+
template <typename Derived>
11913+
void OpenACCClauseTransform<Derived>::VisitDefaultAsyncClause(
11914+
const OpenACCDefaultAsyncClause &C) {
11915+
Expr *IntExpr = const_cast<Expr *>(C.getIntExpr());
11916+
assert(IntExpr && "default_async clause constructed with invalid int expr");
11917+
11918+
ExprResult Res = Self.TransformExpr(IntExpr);
11919+
if (!Res.isUsable())
11920+
return;
11921+
11922+
Res = Self.getSema().OpenACC().ActOnIntExpr(OpenACCDirectiveKind::Invalid,
11923+
C.getClauseKind(),
11924+
C.getBeginLoc(), Res.get());
11925+
if (!Res.isUsable())
11926+
return;
11927+
11928+
ParsedClause.setIntExprDetails(Res.get());
11929+
NewClause = OpenACCDefaultAsyncClause::Create(
11930+
Self.getSema().getASTContext(), ParsedClause.getBeginLoc(),
11931+
ParsedClause.getLParenLoc(), ParsedClause.getIntExprs()[0],
11932+
ParsedClause.getEndLoc());
11933+
}
11934+
1191211935
template <typename Derived>
1191311936
void OpenACCClauseTransform<Derived>::VisitVectorLengthClause(
1191411937
const OpenACCVectorLengthClause &C) {

clang/lib/Serialization/ASTReader.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12412,6 +12412,12 @@ OpenACCClause *ASTRecordReader::readOpenACCClause() {
1241212412
return OpenACCDeviceNumClause::Create(getContext(), BeginLoc, LParenLoc,
1241312413
IntExpr, EndLoc);
1241412414
}
12415+
case OpenACCClauseKind::DefaultAsync: {
12416+
SourceLocation LParenLoc = readSourceLocation();
12417+
Expr *IntExpr = readSubExpr();
12418+
return OpenACCDefaultAsyncClause::Create(getContext(), BeginLoc, LParenLoc,
12419+
IntExpr, EndLoc);
12420+
}
1241512421
case OpenACCClauseKind::VectorLength: {
1241612422
SourceLocation LParenLoc = readSourceLocation();
1241712423
Expr *IntExpr = readSubExpr();
@@ -12601,7 +12607,6 @@ OpenACCClause *ASTRecordReader::readOpenACCClause() {
1260112607
case OpenACCClauseKind::Host:
1260212608
case OpenACCClauseKind::Link:
1260312609
case OpenACCClauseKind::Bind:
12604-
case OpenACCClauseKind::DefaultAsync:
1260512610
case OpenACCClauseKind::Invalid:
1260612611
llvm_unreachable("Clause serialization not yet implemented");
1260712612
}

clang/lib/Serialization/ASTWriter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8340,6 +8340,12 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
83408340
AddStmt(const_cast<Expr*>(DNC->getIntExpr()));
83418341
return;
83428342
}
8343+
case OpenACCClauseKind::DefaultAsync: {
8344+
const auto *DAC = cast<OpenACCDefaultAsyncClause>(C);
8345+
writeSourceLocation(DAC->getLParenLoc());
8346+
AddStmt(const_cast<Expr *>(DAC->getIntExpr()));
8347+
return;
8348+
}
83438349
case OpenACCClauseKind::NumWorkers: {
83448350
const auto *NWC = cast<OpenACCNumWorkersClause>(C);
83458351
writeSourceLocation(NWC->getLParenLoc());
@@ -8536,7 +8542,6 @@ void ASTRecordWriter::writeOpenACCClause(const OpenACCClause *C) {
85368542
case OpenACCClauseKind::Host:
85378543
case OpenACCClauseKind::Link:
85388544
case OpenACCClauseKind::Bind:
8539-
case OpenACCClauseKind::DefaultAsync:
85408545
case OpenACCClauseKind::Invalid:
85418546
llvm_unreachable("Clause serialization not yet implemented");
85428547
}

clang/test/AST/ast-print-openacc-set-construct.cpp

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,18 @@
33
unsigned Int;
44

55
void uses() {
6-
// CHECK: #pragma acc set if(Int == 5) device_type(I) device_num(Int)
6+
// CHECK: #pragma acc set default_async(Int) if(Int == 5) device_type(I) device_num(Int)
77
#pragma acc set default_async(Int) if (Int == 5) device_type(I) device_num(Int)
8-
// CHECK: #pragma acc set device_type(I) device_num(Int)
8+
// CHECK: #pragma acc set default_async(Int) device_type(I) device_num(Int)
99
#pragma acc set default_async(Int) device_type(I) device_num(Int)
10-
// CHECK: #pragma acc set if(Int == 5) device_num(Int)
10+
// CHECK: #pragma acc set default_async(Int) if(Int == 5) device_num(Int)
1111
#pragma acc set default_async(Int) if (Int == 5) device_num(Int)
12-
// CHECK: #pragma acc set if(Int == 5) device_type(I)
12+
// CHECK: #pragma acc set default_async(Int) if(Int == 5) device_type(I)
1313
#pragma acc set default_async(Int) if (Int == 5) device_type(I)
1414
// CHECK: #pragma acc set if(Int == 5) device_type(I) device_num(Int)
1515
#pragma acc set if (Int == 5) device_type(I) device_num(Int)
16-
// CHECK-NOT: default_async(Int)
17-
// TODO: OpenACC: Enable this when we have default_async implemented.
18-
// #pragma acc set default_async(Int)
16+
// CHECK: #pragma acc set default_async(Int)
17+
#pragma acc set default_async(Int)
1918
// CHECK: #pragma acc set if(Int == 5)
2019
#pragma acc set if (Int == 5)
2120
// CHECK: #pragma acc set device_type(I)

clang/test/ParserOpenACC/parse-clauses.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -837,12 +837,8 @@ void IntExprParsing() {
837837
// expected-error@+1{{OpenACC 'set' construct must have at least one 'default_async', 'device_num', 'device_type' or 'if' clause}}
838838
#pragma acc set default_async(5, 4)
839839

840-
// expected-error@+2{{OpenACC 'set' construct must have at least one 'default_async', 'device_num', 'device_type' or 'if' clause}}
841-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented, clause ignored}}
842840
#pragma acc set default_async(5)
843841

844-
// expected-error@+2{{OpenACC 'set' construct must have at least one 'default_async', 'device_num', 'device_type' or 'if' clause}}
845-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented, clause ignored}}
846842
#pragma acc set default_async(returns_int())
847843

848844

clang/test/SemaOpenACC/combined-construct-auto_seq_independent-clauses.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ void uses() {
137137
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'parallel loop' directive}}
138138
#pragma acc parallel loop auto device_num(1)
139139
for(unsigned i = 0; i < 5; ++i);
140-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented}}
140+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'parallel loop' directive}}
141141
#pragma acc parallel loop auto default_async(1)
142142
for(unsigned i = 0; i < 5; ++i);
143143
#pragma acc parallel loop auto device_type(*)
@@ -254,7 +254,7 @@ void uses() {
254254
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'parallel loop' directive}}
255255
#pragma acc parallel loop device_num(1) auto
256256
for(unsigned i = 0; i < 5; ++i);
257-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented}}
257+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'parallel loop' directive}}
258258
#pragma acc parallel loop default_async(1) auto
259259
for(unsigned i = 0; i < 5; ++i);
260260
#pragma acc parallel loop device_type(*) auto
@@ -372,7 +372,7 @@ void uses() {
372372
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'parallel loop' directive}}
373373
#pragma acc parallel loop independent device_num(1)
374374
for(unsigned i = 0; i < 5; ++i);
375-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented}}
375+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'parallel loop' directive}}
376376
#pragma acc parallel loop independent default_async(1)
377377
for(unsigned i = 0; i < 5; ++i);
378378
#pragma acc parallel loop independent device_type(*)
@@ -489,7 +489,7 @@ void uses() {
489489
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'parallel loop' directive}}
490490
#pragma acc parallel loop device_num(1) independent
491491
for(unsigned i = 0; i < 5; ++i);
492-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented}}
492+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'parallel loop' directive}}
493493
#pragma acc parallel loop default_async(1) independent
494494
for(unsigned i = 0; i < 5; ++i);
495495
#pragma acc parallel loop device_type(*) independent
@@ -615,7 +615,7 @@ void uses() {
615615
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'parallel loop' directive}}
616616
#pragma acc parallel loop seq device_num(1)
617617
for(unsigned i = 0; i < 5; ++i);
618-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented}}
618+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'parallel loop' directive}}
619619
#pragma acc parallel loop seq default_async(1)
620620
for(unsigned i = 0; i < 5; ++i);
621621
#pragma acc parallel loop seq device_type(*)
@@ -738,7 +738,7 @@ void uses() {
738738
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'parallel loop' directive}}
739739
#pragma acc parallel loop device_num(1) seq
740740
for(unsigned i = 0; i < 5; ++i);
741-
// expected-warning@+1{{OpenACC clause 'default_async' not yet implemented}}
741+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'parallel loop' directive}}
742742
#pragma acc parallel loop default_async(1) seq
743743
for(unsigned i = 0; i < 5; ++i);
744744
#pragma acc parallel loop device_type(*) seq

clang/test/SemaOpenACC/combined-construct-device_type-clause.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -193,8 +193,7 @@ void uses() {
193193
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'serial loop' directive}}
194194
#pragma acc serial loop device_type(*) device_num(1)
195195
for(int i = 0; i < 5; ++i);
196-
// expected-error@+2{{OpenACC clause 'default_async' may not follow a 'device_type' clause in a 'serial loop' construct}}
197-
// expected-note@+1{{previous clause is here}}
196+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'serial loop' directive}}
198197
#pragma acc serial loop device_type(*) default_async(1)
199198
for(int i = 0; i < 5; ++i);
200199
#pragma acc parallel loop device_type(*) async

clang/test/SemaOpenACC/compute-construct-device_type-clause.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,7 @@ void uses() {
198198
// expected-error@+1{{OpenACC 'device_num' clause is not valid on 'kernels' directive}}
199199
#pragma acc kernels device_type(*) device_num(1)
200200
while(1);
201-
// expected-error@+2{{OpenACC clause 'default_async' may not follow a 'device_type' clause in a 'kernels' construct}}
202-
// expected-note@+1{{previous clause is here}}
201+
// expected-error@+1{{OpenACC 'default_async' clause is not valid on 'kernels' directive}}
203202
#pragma acc kernels device_type(*) default_async(1)
204203
while(1);
205204
#pragma acc kernels device_type(*) async

0 commit comments

Comments
 (0)