[clang] [NVPTX] Add support for maxclusterrank in launch_bounds (PR #66496)
Artem Belevich via cfe-commits
cfe-commits at lists.llvm.org
Thu Sep 21 09:29:12 PDT 2023
================
@@ -5650,34 +5665,51 @@ static Expr *makeLaunchBoundsArgExpr(Sema &S, Expr *E,
CUDALaunchBoundsAttr *
Sema::CreateLaunchBoundsAttr(const AttributeCommonInfo &CI, Expr *MaxThreads,
- Expr *MinBlocks) {
- CUDALaunchBoundsAttr TmpAttr(Context, CI, MaxThreads, MinBlocks);
+ Expr *MinBlocks, Expr *MaxBlocks) {
+ CUDALaunchBoundsAttr TmpAttr(Context, CI, MaxThreads, MinBlocks, MaxBlocks);
MaxThreads = makeLaunchBoundsArgExpr(*this, MaxThreads, TmpAttr, 0);
- if (MaxThreads == nullptr)
+ if (!MaxThreads)
return nullptr;
if (MinBlocks) {
MinBlocks = makeLaunchBoundsArgExpr(*this, MinBlocks, TmpAttr, 1);
- if (MinBlocks == nullptr)
+ if (!MinBlocks)
return nullptr;
}
+ if (MaxBlocks) {
+ // Feature '.maxclusterrank' requires .target sm_90 or higher.
----------------
Artem-B wrote:
Nit: `.maxclusterrank` is a PTX directive.
https://github.com/llvm/llvm-project/pull/66496
More information about the cfe-commits
mailing list