Skip to content

Commit c46a95c

Browse files
authored
[MLIR] Fix documentation generation for DLTI dialect. (#97052)
This patch fixes the docs generation for the DLTI dialect to include attributes (CMake config pointed to the wrong tablegen file). It also fixes formatting in places so that proper markdown is generated.
1 parent 11484cb commit c46a95c

File tree

2 files changed

+19
-23
lines changed

2 files changed

+19
-23
lines changed

mlir/include/mlir/Dialect/DLTI/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
add_mlir_dialect(DLTI dlti)
2-
add_mlir_doc(DLTI DLTIDialect Dialects/ -gen-dialect-doc)
2+
add_mlir_doc(DLTIAttrs DLTIDialect Dialects/ -gen-dialect-doc)
33

44
set(LLVM_TARGET_DEFINITIONS DLTIAttrs.td)
55
mlir_tablegen(DLTIAttrs.h.inc -gen-attrdef-decls -attrdefs-dialect=dlti)

mlir/include/mlir/Dialect/DLTI/DLTIAttrs.td

Lines changed: 18 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,7 @@ def DataLayoutEntryTrait
2727

2828
def DLTI_DataLayoutEntryAttr :
2929
DLTIAttr<"DataLayoutEntry", [DataLayoutEntryTrait]> {
30-
let summary = [{
31-
An attribute to represent an entry of a data layout specification.
32-
}];
30+
let summary = "An attribute to represent an entry of a data layout specification.";
3331
let description = [{
3432
A data layout entry attribute is a key-value pair where the key is a type or
3533
an identifier and the value is another attribute. These entries form a data
@@ -62,9 +60,7 @@ def DataLayoutSpecTrait
6260

6361
def DLTI_DataLayoutSpecAttr :
6462
DLTIAttr<"DataLayoutSpec", [DataLayoutSpecTrait]> {
65-
let summary = [{
66-
An attribute to represent a data layout specification.
67-
}];
63+
let summary = "An attribute to represent a data layout specification.";
6864
let description = [{
6965
A data layout specification is a list of entries that specify (partial) data
7066
layout information. It is expected to be attached to operations that serve
@@ -111,23 +107,23 @@ def TargetSystemSpecTrait
111107

112108
def DLTI_TargetSystemSpecAttr :
113109
DLTIAttr<"TargetSystemSpec", [TargetSystemSpecTrait]> {
114-
let summary = [{
115-
An attribute to represent target system specification.
116-
}];
110+
let summary = "An attribute to represent target system specification.";
117111
let description = [{
118112
A system specification describes the overall system containing
119113
multiple devices, with each device having a unique ID (string)
120114
and its corresponding TargetDeviceSpec object.
121115

122116
Example:
123-
dlti.target_system_spec =
124-
#dlti.target_system_spec<
125-
"CPU": #dlti.target_device_spec<
126-
#dlti.dl_entry<"dlti.L1_cache_size_in_bytes", 4096: ui32>>,
127-
"GPU": #dlti.target_device_spec<
128-
#dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>,
129-
"XPU": #dlti.target_device_spec<
130-
#dlti.dl_entry<"dlti.max_vector_op_width", 4096 : ui32>>>
117+
```
118+
dlti.target_system_spec =
119+
#dlti.target_system_spec<
120+
"CPU": #dlti.target_device_spec<
121+
#dlti.dl_entry<"dlti.L1_cache_size_in_bytes", 4096: ui32>>,
122+
"GPU": #dlti.target_device_spec<
123+
#dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>,
124+
"XPU": #dlti.target_device_spec<
125+
#dlti.dl_entry<"dlti.max_vector_op_width", 4096 : ui32>>>
126+
```
131127
}];
132128
let parameters = (ins
133129
ArrayRefParameter<"DeviceIDTargetDeviceSpecPair", "">:$entries
@@ -165,17 +161,17 @@ def TargetDeviceSpecTrait
165161

166162
def DLTI_TargetDeviceSpecAttr :
167163
DLTIAttr<"TargetDeviceSpec", [TargetDeviceSpecTrait]> {
168-
let summary = [{
169-
An attribute to represent target device specification.
170-
}];
164+
let summary = "An attribute to represent target device specification.";
171165
let description = [{
172166
Each device specification describes a single device and its
173167
hardware properties. Each device specification can contain any number
174168
of optional hardware properties (e.g., max_vector_op_width below).
175169

176170
Example:
177-
#dlti.target_device_spec<
178-
#dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>
171+
```
172+
#dlti.target_device_spec<
173+
#dlti.dl_entry<"dlti.max_vector_op_width", 64 : ui32>>
174+
```
179175
}];
180176
let parameters = (ins
181177
ArrayRefParameter<"DataLayoutEntryInterface", "">:$entries

0 commit comments

Comments
 (0)