Skip to content

Commit 7361874

Browse files
committed
add documentation
1 parent 714faa2 commit 7361874

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

clang/include/clang/Basic/Attr.td

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1567,14 +1567,14 @@ def CUDAClusterDims : InheritableAttr {
15671567
let Args = [ExprArgument<"X">, ExprArgument<"Y", 1>, ExprArgument<"Z", 1>];
15681568
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
15691569
let LangOpts = [CUDA];
1570-
let Documentation = [Undocumented];
1570+
let Documentation = [CUDAClusterDimsAttrDoc];
15711571
}
15721572

15731573
def CUDANoCluster : InheritableAttr {
15741574
let Spellings = [GNU<"no_cluster">, Declspec<"__no_cluster__">];
15751575
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
15761576
let LangOpts = [CUDA];
1577-
let Documentation = [Undocumented];
1577+
let Documentation = [CUDANoClusterAttrDoc];
15781578
}
15791579

15801580
def : MutualExclusions<[CUDAClusterDims, CUDANoCluster]>;

clang/include/clang/Basic/AttrDocs.td

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7532,6 +7532,25 @@ A managed variable can be accessed in both device and host code.
75327532
}];
75337533
}
75347534

7535+
def CUDAClusterDimsAttrDoc : Documentation {
7536+
let Category = DocCatDecl;
7537+
let Content = [{
7538+
In CUDA/HIP programming, the ``__cluster_dims__`` attribute can be applied to a kernel function
7539+
to set the dimensions of a thread block cluster. This allows to group multiple thread blocks into
7540+
a larger unit called a "cluster". `__cluster_dims__` defines the cluster size as ``(X, Y, Z)``,
7541+
where each value is the number of thread blocks in that dimension.
7542+
}];
7543+
}
7544+
7545+
def CUDANoClusterAttrDoc : Documentation {
7546+
let Category = DocCatDecl;
7547+
let Content = [{
7548+
In CUDA/HIP programming, the ``__no_cluster__`` attribute can be applied to a kernel function to
7549+
indicate that the thread block cluster feature will not be enabled at both compile time and kernel
7550+
launch time. Note: this is a LLVM/Clang only attribute.
7551+
}];
7552+
}
7553+
75357554
def LifetimeOwnerDocs : Documentation {
75367555
let Category = DocCatDecl;
75377556
let Content = [{

0 commit comments

Comments
 (0)