diff --git a/docs/Makefile b/docs/Makefile index 800b4020ab21a30f920105cee12613bc0a1749e7..a293f14ee04261a3d46ac9e6b0924b5b62107a6b 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -12,12 +12,7 @@ BUILDDIR = build help: @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) -clean: - rm -rf source/reference/generated - rm -rf source/backend/generated - @$(SPHINXBUILD) -M clean "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) - -.PHONY: help clean Makefile +.PHONY: help html clean # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/docs/source/api/codegen.rst b/docs/source/api/codegen.rst index cf8db1700895b32c5e86291270190a0cf421dbde..d65e9a358296d017e11395050e5767d82d6569ac 100644 --- a/docs/source/api/codegen.rst +++ b/docs/source/api/codegen.rst @@ -3,15 +3,14 @@ pystencils.codegen .. module:: pystencils.codegen -Kernel Creation Driver ----------------------- +Invocation +---------- .. autosummary:: :toctree: generated :nosignatures: create_kernel - get_driver Configuration ------------- @@ -43,6 +42,22 @@ Target Specification Target +Code Generation Drivers +----------------------- + +.. autosummary:: + :toctree: generated + :nosignatures: + :template: autosummary/entire_class.rst + + driver.DefaultKernelCreationDriver + +.. autosummary:: + :toctree: generated + :nosignatures: + + get_driver + Output Code Objects ------------------- diff --git a/src/pystencils/codegen/driver.py b/src/pystencils/codegen/driver.py index 62a3f44db98cf4559f77d187e4c1ed3afb8e92b7..2ab9063667920f8b7651934cbcdad07599858758 100644 --- a/src/pystencils/codegen/driver.py +++ b/src/pystencils/codegen/driver.py @@ -81,10 +81,25 @@ def create_kernel( def get_driver(cfg: CreateKernelConfig, *, retain_intermediates: bool = False): + """Create a code generation driver object from the given configuration. + + Args: + cfg: Configuration for the code generator + retain_intermediates: If `True`, instructs the driver to keep copies of + the intermediate results of its stages for later inspection. + """ return DefaultKernelCreationDriver(cfg, retain_intermediates) class DefaultKernelCreationDriver: + """Drives the default kernel creation sequence. + + Args: + cfg: Configuration for the code generator + retain_intermediates: If `True`, instructs the driver to keep copies of + the intermediate results of its stages for later inspection. + """ + def __init__(self, cfg: CreateKernelConfig, retain_intermediates: bool = False): self._cfg = cfg