Select Git revision
generate.py
codegen.md 2.98 KiB
Code Generation
Invocation
.. module:: pystencils.codegen
.. autosummary::
:toctree: generated
:nosignatures:
create_kernel
Configuration
.. module:: pystencils.codegen.config
The code generation driver (create_kernel
, but also DefaultKernelCreationDriver
) can be configured by
passing it a CreateKernelConfig
object.
This object can be constructed incrementally:
cfg = ps.CreateKernelConfig()
cfg.default_dtype = "float32"
cfg.target = ps.Target.X86_AVX
cfg.cpu.openmp.enable = True
cfg.cpu.vectorize.enable = True
cfg.cpu.vectorize.assume_inner_stride_one = True
Options and Option Categories
The following options and option categories are exposed by the configuration object:
Target Specification
.. current
.. autosummary::
~CreateKernelConfig.target
Data Types
.. autosummary::
~CreateKernelConfig.default_dtype
~CreateKernelConfig.index_dtype
Iteration Space
.. autosummary::
~CreateKernelConfig.ghost_layers
~CreateKernelConfig.iteration_slice
~CreateKernelConfig.index_field
Kernel Constraint Checks
.. autosummary::
~CreateKernelConfig.allow_double_writes
~CreateKernelConfig.skip_independence_check
Target-Specific Options
The following categories with target-specific options are exposed:
{any}cpu <CpuOptions>
|
Options for CPU kernels |
{any}gpu <GpuOptions>
|
Options for GPU kernels |
{any}sycl <SyclOptions>
|
Options for SYCL kernels |