Skip to content
Snippets Groups Projects
Commit 07c66d67 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

some fixes to the documentation

parent 0ff6bb94
Branches fhennig/sycl
No related tags found
No related merge requests found
......@@ -4,10 +4,15 @@ Kernel Creation
The primary interface for creating numerical kernels in pystencils is the function `create_kernel`.
Configuration
=============
.. autoclass:: pystencils.CreateKernelConfig
.. automodule:: pystencils.config
:members:
Creation
========
.. autofunction:: pystencils.create_kernel
.. autoclass:: pystencils.backend.KernelFunction
......
......@@ -2,11 +2,29 @@
Abstract Syntax Tree
********************
Inheritance Diagramm
====================
.. inheritance-diagram:: pystencils.backend.ast.astnode.PsAstNode pystencils.backend.ast.structural pystencils.backend.ast.expressions pystencils.backend.extensions.foreign_ast
:top-classes: pystencils.types.PsAstNode
:parts: 1
Base Classes
============
.. automodule:: pystencils.backend.ast.astnode
:members:
Structural Nodes
================
.. automodule:: pystencils.backend.ast.structural
:members:
Expressions
===========
.. automodule:: pystencils.backend.ast.expressions
:members:
************************************
Extensions and Experimental Features
************************************
.. automodule:: pystencils.backend.extensions
......@@ -16,6 +16,7 @@ who wish to customize or extend the behaviour of the code generator in their app
platforms
transformations
jit
extensions
Internal Representation
-----------------------
......
"""
The module `pystencils.backend.extensions` contains extensions to the pystencils code generator
beyond its core functionality.
The tools and classes of this module are considered experimental;
their support by the remaining code generator is limited.
They can be used to model and generate code outside of the usual scope of pystencils,
such as non-standard syntax and types.
At the moment, the primary use case is the modelling of C++ syntax.
Foreign Syntax Support
======================
.. automodule:: pystencils.backend.extensions.foreign_ast
:members:
C++ Language Support
====================
.. automodule:: pystencils.backend.extensions.cpp
:members:
"""
from .foreign_ast import PsForeignExpression
__all__ = ["PsForeignExpression"]
......@@ -14,12 +14,12 @@ class PsForeignExpression(PsExpression, ABC):
Foreign expressions are expressions whose properties are not modelled by the pystencils AST,
and which pystencils therefore does not understand.
Support for foreign expressions by the code generator is therefore very limited;
as a rule of thumb, only printing is supported.
Type checking and most transformations will fail when encountering a `PsForeignExpression`.
There are many situations where non-supported expressions are needed;
the most common use case is C++ syntax.
Support for foreign expressions by the code generator is therefore very limited;
as a rule of thumb, only printing is supported.
Type checking and most transformations will fail when encountering a `PsForeignExpression`.
"""
__match_args__ = ("children",)
......
......@@ -121,7 +121,7 @@ class VectorizationConfig:
@dataclass
class GpuIndexingConfig:
"""Configure index translation behaviour inside kernels generated for `Target.SYCL`."""
"""Configure index translation behaviour for kernels generated for GPU targets."""
omit_range_check: bool = False
"""If set to `True`, omit the iteration counter range check.
......@@ -134,10 +134,13 @@ class GpuIndexingConfig:
sycl_automatic_block_size: bool = True
"""If set to `True` while generating for `Target.SYCL`, let the SYCL runtime decide on the block size.
If set to `True`, the kernel is generated for execution via ``parallel_for``-dispatch using
If set to `True`, the kernel is generated for execution via
`parallel_for <https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_parallel_for_invoke>`_
-dispatch using
a flat `sycl::range`. In this case, the GPU block size will be inferred by the SYCL runtime.
If set to `False`, the kernel will receive an `nd_item` and has to be executed using ``parallel_for``
If set to `False`, the kernel will receive an `nd_item` and has to be executed using
`parallel_for <https://registry.khronos.org/SYCL/specs/sycl-2020/html/sycl-2020.html#_parallel_for_invoke>`_
with an `nd_range`. This allows manual specification of the block size.
"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment