Skip to content

Commit 6d21ce8

Browse files
authored
[OpenACC][CIR] device_resident lowering for NS/global/struct declare (#169507)
This is the same as create/copyin, except it uses declare_device_resident for the entry op.
1 parent c582688 commit 6d21ce8

File tree

2 files changed

+257
-4
lines changed

2 files changed

+257
-4
lines changed

clang/lib/CIR/CodeGen/CIRGenDeclOpenACC.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ class OpenACCGlobalDeclareClauseEmitter final
262262
/*structured=*/true,
263263
/*implicit=*/false, /*requiresDtor=*/true);
264264
}
265+
266+
void VisitDeviceResidentClause(const OpenACCDeviceResidentClause &clause) {
267+
for (const Expr *var : clause.getVarList())
268+
cgm.emitGlobalOpenACCDeclareDataOperands<
269+
mlir::acc::DeclareDeviceResidentOp>(
270+
var, mlir::acc::DataClause::acc_declare_device_resident, {},
271+
/*structured=*/true,
272+
/*implicit=*/false, /*requiresDtor=*/true);
273+
}
265274
};
266275
} // namespace
267276

0 commit comments

Comments
 (0)