Skip to content

Commit 0f86cb3

Browse files
authored
[MLIR][OpenMP][Docs] Reorganize 'omp' dialect documentation (NFC) (#107232)
This patch creates a handwritten main documentation page for the OpenMP dialect linking to the ODS-generated one as a sub-section. This new page can be extended to better describe overall design decisions of the dialect rather than relying exclusively on documentation generated automatically from ODS descriptions. After some investigation, there seem to be a few main ways we could structure dialect documentation to allow the introduction of possibly extensive handwritten text. - Create a top-level OpenMPDialect.td file that includes the auto-generated one. This is what the `acc` dialect currently does, but it results in the addition of two equal TOCs. It would be possible to move the `include` before all handwritten sections so that the page would have a single TOC, but I believe moving general descriptions to the end of the document would hurt readability. Also keeping the section order without introducing a second TOC would mean the TOC would be inserted somewhere halfway through the page, which isn't useful. - Create an OpenMPDialect directory with an _index.md including the auto-generated documentation. This is a different way of reproducing the same issues described above, which is what is currently done for the `linalg` dialect. The multiple TOC issue there is avoided by only including automatically-generated documentation for operations (i.e. `mlir-tblgen -gen-op-doc`) rather than for dialects (i.e. `mlir-tblgen -gen-dialect-doc`). That approach would make it impossible to generate all of the documentation without adding new tablegen backends for `DialectAttr`, `DialectType` and `EnumAttrInfo` definitions or making the TOC optional through a command line option. - Create an OpenMPDialect directory with an _index.md that does not include the auto-generated documentation. Instead, link to another document in that directory that includes it. This is the approach taken here, and it circumvents all these issues without having to make any changes to tablegen backends.
1 parent dbdf843 commit 0f86cb3

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# ODS Documentation
2+
3+
[include "Dialects/OpenMPDialect.md"]
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 'omp' Dialect
2+
3+
The `omp` dialect is for representing directives, clauses and other definitions
4+
of the [OpenMP programming model](https://www.openmp.org). This directive-based
5+
programming model, defined for the C, C++ and Fortran programming languages,
6+
provides abstractions to simplify the development of parallel and accelerated
7+
programs. All versions of the OpenMP specification can be found
8+
[here](https://www.openmp.org/specifications/).
9+
10+
Operations in this MLIR dialect generally correspond to a single OpenMP
11+
directive, taking arguments that represent their supported clauses, though this
12+
is not always the case. For a detailed information of operations, types and
13+
other definitions in this dialect, refer to the automatically-generated
14+
[ODS Documentation](ODS.md).
15+
16+
[TOC]

0 commit comments

Comments
 (0)