Skip to content

Commit e57c037

Browse files
committed
add documentation
1 parent 33c4ac0 commit e57c037

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
@@ -1562,14 +1562,14 @@ def CUDAClusterDims : InheritableAttr {
15621562
let Args = [ExprArgument<"X">, ExprArgument<"Y", 1>, ExprArgument<"Z", 1>];
15631563
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
15641564
let LangOpts = [CUDA];
1565-
let Documentation = [Undocumented];
1565+
let Documentation = [CUDAClusterDimsAttrDoc];
15661566
}
15671567

15681568
def CUDANoCluster : InheritableAttr {
15691569
let Spellings = [GNU<"no_cluster">, Declspec<"__no_cluster__">];
15701570
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
15711571
let LangOpts = [CUDA];
1572-
let Documentation = [Undocumented];
1572+
let Documentation = [CUDANoClusterAttrDoc];
15731573
}
15741574

15751575
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)