Code Generation#
Invocation#
Create a kernel function from a set of assignments. |
Configuration#
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#
The code generation target. |
Data Types#
Default numeric data type. |
|
Data type used for all index calculations. |
Iteration Space#
Specifies the number of ghost layers of the iteration region. |
|
Specifies the kernel's iteration slice. |
|
Index field for a sparse kernel. |
Kernel Constraint Checks#
If True, don't check if every field is only written at a single location. |
|
By default the assignment list is checked for read/write independence. |
Target-Specific Options#
The following categories with target-specific options are exposed:
Kernel Object and Just-In-Time Compilation#
Name of the generated function |
|
Just-in-time compiler used to compile and load the kernel for invocation from the current Python environment. |
Configuration System Classes#
Options for create_kernel. |
|
Configuration options specific to CPU targets. |
|
Configuration options controlling automatic OpenMP instrumentation. |
|
Configuration for the auto-vectorizer. |
|
Configuration options specific to GPU targets. |
|
Options specific to the |
|
Available index translation schemes for GPU kernels. |
Special value that can be passed to some options for invoking automatic behaviour. |
Implementation Details
Option descriptor. |
|
Subclass of Option where |
|
Descriptor for a category of options. |
|
Base class for configuration categories. |
Target Specification#
The Target enumeration represents all possible targets that can be used for code generation. |
Code Generation Drivers#
Drives the default kernel creation sequence. |
Create a code generation driver object from the given configuration. |