Skip to content

Commit 182dab2

Browse files
committed
add documentation
1 parent a01f9f9 commit 182dab2

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
@@ -1577,14 +1577,14 @@ def CUDAClusterDims : InheritableAttr {
15771577
let Args = [ExprArgument<"X">, ExprArgument<"Y", 1>, ExprArgument<"Z", 1>];
15781578
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
15791579
let LangOpts = [CUDA];
1580-
let Documentation = [Undocumented];
1580+
let Documentation = [CUDAClusterDimsAttrDoc];
15811581
}
15821582

15831583
def CUDANoCluster : InheritableAttr {
15841584
let Spellings = [GNU<"no_cluster">, Declspec<"__no_cluster__">];
15851585
let Subjects = SubjectList<[Function], ErrorDiag, "kernel functions">;
15861586
let LangOpts = [CUDA];
1587-
let Documentation = [Undocumented];
1587+
let Documentation = [CUDANoClusterAttrDoc];
15881588
}
15891589

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

clang/include/clang/Basic/AttrDocs.td

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

7548+
def CUDAClusterDimsAttrDoc : Documentation {
7549+
let Category = DocCatDecl;
7550+
let Content = [{
7551+
In CUDA/HIP programming, the ``__cluster_dims__`` attribute can be applied to a kernel function
7552+
to set the dimensions of a thread block cluster. This allows to group multiple thread blocks into
7553+
a larger unit called a "cluster". `__cluster_dims__` defines the cluster size as ``(X, Y, Z)``,
7554+
where each value is the number of thread blocks in that dimension.
7555+
}];
7556+
}
7557+
7558+
def CUDANoClusterAttrDoc : Documentation {
7559+
let Category = DocCatDecl;
7560+
let Content = [{
7561+
In CUDA/HIP programming, the ``__no_cluster__`` attribute can be applied to a kernel function to
7562+
indicate that the thread block cluster feature will not be enabled at both compile time and kernel
7563+
launch time. Note: this is a LLVM/Clang only attribute.
7564+
}];
7565+
}
7566+
75487567
def LifetimeOwnerDocs : Documentation {
75497568
let Category = DocCatDecl;
75507569
let Content = [{

0 commit comments

Comments
 (0)