Skip to content

Commit 3ea2ce9

Browse files
authored
docs: housekeeping + memref dialect (EnzymeAD#846)
* docs: housekeeping + memref dialect * docs: autoadd dialects
1 parent d2ff1aa commit 3ea2ce9

File tree

19 files changed

+59
-33
lines changed

19 files changed

+59
-33
lines changed

docs/make.jl

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ using Documenter, DocumenterVitepress
33

44
DocMeta.setdocmeta!(Reactant, :DocTestSetup, :(using Reactant); recursive=true)
55

6+
# Helper functions
7+
function first_letter_uppercase(str)
8+
return uppercase(str[1]) * str[2:end]
9+
end
10+
611
# Generate examples
712

813
using Literate
@@ -32,16 +37,15 @@ pages = [
3237
"API Reference" => [
3338
"Reactant API" => "api/api.md",
3439
"Ops" => "api/ops.md",
35-
"Dialects" => [
36-
"ArithOps" => "api/arith.md",
37-
"Affine" => "api/affine.md",
38-
"Builtin" => "api/builtin.md",
39-
"Chlo" => "api/chlo.md",
40-
"Enzyme" => "api/enzyme.md",
41-
"Func" => "api/func.md",
42-
"StableHLO" => "api/stablehlo.md",
43-
"VHLO" => "api/vhlo.md",
44-
],
40+
"Dialects" => sort!(
41+
[
42+
first_letter_uppercase(first(splitext(basename(file)))) =>
43+
joinpath("api/dialects", file) for
44+
file in readdir(joinpath(@__DIR__, "src/api/dialects")) if
45+
splitext(file)[2] == ".md"
46+
];
47+
by=first,
48+
),
4549
"MLIR API" => "api/mlirc.md",
4650
"XLA" => "api/xla.md",
4751
"Internal API" => "api/internal.md",
@@ -56,14 +60,13 @@ makedocs(;
5660
Reactant.MLIR,
5761
Reactant.MLIR.API,
5862
Reactant.MLIR.IR,
59-
Reactant.MLIR.Dialects.chlo,
60-
Reactant.MLIR.Dialects.vhlo,
61-
Reactant.MLIR.Dialects.stablehlo,
62-
Reactant.MLIR.Dialects.enzyme,
63-
Reactant.MLIR.Dialects.arith,
64-
Reactant.MLIR.Dialects.func,
65-
Reactant.MLIR.Dialects.affine,
66-
Reactant.MLIR.Dialects.builtin,
63+
filter(
64+
Base.Fix2(isa, Module),
65+
[
66+
getproperty(Reactant.MLIR.Dialects, x) for
67+
x in names(Reactant.MLIR.Dialects; all=true) if x != :Dialects
68+
],
69+
)...,
6770
],
6871
authors="William Moses <[email protected]>, Valentin Churavy <[email protected]>",
6972
sitename="Reactant.jl",

docs/src/.vitepress/config.mts

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,21 +136,23 @@ export default defineConfig({
136136
text: "MLIR Dialects",
137137
collapsed: false,
138138
items: [
139-
{ text: "ArithOps", link: "/api/arith" },
140-
{ text: "Affine", link: "/api/affine" },
141-
{ text: "Builtin", link: "/api/builtin" },
142-
{ text: "Chlo", link: "/api/chlo" },
143-
{ text: "Enzyme", link: "/api/enzyme" },
144-
{ text: "Func", link: "/api/func" },
145-
{ text: "StableHLO", link: "/api/stablehlo" },
146-
{ text: "VHLO", link: "/api/vhlo" },
147-
{ text: "GPU", link: "/api/gpu" },
148-
{ text: "LLVM", link: "/api/llvm" },
149-
{ text: "NVVM", link: "/api/nvvm" },
150-
{ text: "TPU", link: "/api/tpu" },
151-
{ text: "Triton", link: "/api/triton" },
152-
{ text: "Shardy", link: "/api/shardy" },
153-
{ text: "MPI", link: "/api/mpi" },
139+
{ text: "ArithOps", link: "/api/dialects/arith" },
140+
{ text: "Affine", link: "/api/dialects/affine" },
141+
{ text: "Builtin", link: "/api/dialects/builtin" },
142+
{ text: "Chlo", link: "/api/dialects/chlo" },
143+
{ text: "Enzyme", link: "/api/dialects/enzyme" },
144+
{ text: "EnzymeXLA", link: "/api/dialects/enzymexla" },
145+
{ text: "Func", link: "/api/dialects/func" },
146+
{ text: "GPU", link: "/api/dialects/gpu" },
147+
{ text: "LLVM", link: "/api/dialects/llvm" },
148+
{ text: "MPI", link: "/api/dialects/mpi" },
149+
{ text: "MemRef", link: "/api/dialects/memref" },
150+
{ text: "NVVM", link: "/api/dialects/nvvm" },
151+
{ text: "Shardy", link: "/api/dialects/shardy" },
152+
{ text: "StableHLO", link: "/api/dialects/stablehlo" },
153+
{ text: "Triton", link: "/api/dialects/triton" },
154+
{ text: "TPU", link: "/api/dialects/tpu" },
155+
{ text: "VHLO", link: "/api/dialects/vhlo" },
154156
],
155157
},
156158
{
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

docs/src/api/dialects/enzymexla.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
```@meta
2+
CollapsedDocStrings = true
3+
```
4+
5+
# EnzymeXLA Dialect
6+
7+
```@autodocs
8+
Modules = [Reactant.MLIR.Dialects.enzymexla]
9+
```
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)