Skip to content

Commit 5271f9f

Browse files
[Flang][Doc] NFC: Minor fix for headings (#147077)
Use a top level section to ensure that there is only one entry in the flang.llvm.org/docs page. Also generate a table of contents.
1 parent 1c8283a commit 5271f9f

File tree

2 files changed

+23
-8
lines changed

2 files changed

+23
-8
lines changed

flang/docs/OpenMP-declare-target.md

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,15 @@
77
88
-->
99

10-
# Introduction to Declare Target
10+
# OpenMP Declare Target
11+
12+
```{contents}
13+
---
14+
local:
15+
---
16+
```
17+
18+
## Introduction to Declare Target
1119

1220
In OpenMP `declare target` is a directive that can be applied to a function or
1321
variable (primarily global) to notate to the compiler that it should be
@@ -55,7 +63,7 @@ in this case, leave off the `declare target` from the function and it
5563
would be implicitly marked `declare target any` (for both host and device),
5664
as it's been utilised within a target region.
5765

58-
# Declare Target as represented in the OpenMP Dialect
66+
## Declare Target as represented in the OpenMP Dialect
5967

6068
In the OpenMP Dialect `declare target` is not represented by a specific
6169
`operation`. Instead, it's an OpenMP dialect specific `attribute` that can be
@@ -89,7 +97,7 @@ llvm::dyn_cast<mlir::omp::DeclareTargetInterface>(Op.getOperation());
8997
declareTargetGlobal.isDeclareTarget();
9098
```
9199

92-
# Declare Target Fortran OpenMP Lowering
100+
## Declare Target Fortran OpenMP Lowering
93101

94102
The initial lowering of `declare target` to MLIR for both use-cases is done
95103
inside of the usual OpenMP lowering in flang/lib/Lower/OpenMP.cpp. However,
@@ -145,7 +153,7 @@ to the way `threadprivate` handles these cases, we raise and initialize the
145153
variable as an internal `GlobalOp` and apply the attribute. This occurs in the
146154
flang/lib/Lower/OpenMP.cpp function `genDeclareTargetIntGlobal`.
147155

148-
# Declare Target Transformation Passes for Flang
156+
## Declare Target Transformation Passes for Flang
149157

150158
There are currently two passes within Flang that are related to the processing
151159
of `declare target`:
@@ -173,7 +181,7 @@ While this infrastructure could be generally applicable to more than just Flang,
173181
it is only utilised in the Flang frontend, so it resides there rather than in
174182
the OpenMP dialect codebase.
175183

176-
# Declare Target OpenMP Dialect To LLVM-IR Lowering
184+
## Declare Target OpenMP Dialect To LLVM-IR Lowering
177185

178186
The OpenMP dialect lowering of `declare target` is done through the
179187
`amendOperation` flow, as it's not an `operation` but rather an
@@ -228,7 +236,7 @@ place. It may be possible to store this information in the OMPIRBuilder and
228236
then perform this cleanup process on finalization, but this is open for
229237
discussion and implementation still.
230238

231-
# Current Support
239+
## Current Support
232240

233241
For the moment, `declare target` should work for:
234242
* Marking functions/subroutines and function/subroutine interfaces for

flang/docs/OpenMP-descriptor-management.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,15 @@
66
77
-->
88

9-
# OpenMP dialect: Fortran descriptor type mapping for offload
9+
# Fortran descriptor type mapping for OpenMP offload
10+
```{contents}
11+
---
12+
local:
13+
---
14+
```
15+
1016

17+
## Details
1118
The initial method for mapping Fortran types tied to descriptors for OpenMP offloading is to treat these types
1219
as a special case of OpenMP record type (C/C++ structure/class, Fortran derived type etc.) mapping as far as the
1320
runtime is concerned. Where the box (descriptor information) is the holding container and the underlying
@@ -103,7 +110,7 @@ it is a little rigid in how the descriptor mappings are handled as there is no s
103110
to specialise the mappings for possible edge cases without polluting the dialect or lowering with further
104111
knowledge of Fortran and the FIR dialect.
105112
106-
# OpenMP dialect differences from OpenACC dialect
113+
## Differences from OpenACC
107114
108115
The descriptor mapping for OpenMP currently works differently to the planned direction for OpenACC, however,
109116
it is possible and would likely be ideal to align the method with OpenACC in the future.

0 commit comments

Comments
 (0)