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

add empty cpu optimization driver. refactor intrinsic selection module.

parent 05149095
No related merge requests found
Pipeline #64443 failed with stages
in 2 minutes and 44 seconds
...@@ -10,6 +10,8 @@ from .iteration_space import ( ...@@ -10,6 +10,8 @@ from .iteration_space import (
create_sparse_iteration_space, create_sparse_iteration_space,
) )
from .cpu_optimization import optimize_cpu
__all__ = [ __all__ = [
"KernelCreationContext", "KernelCreationContext",
"KernelAnalysis", "KernelAnalysis",
...@@ -19,4 +21,5 @@ __all__ = [ ...@@ -19,4 +21,5 @@ __all__ = [
"SparseIterationSpace", "SparseIterationSpace",
"create_full_iteration_space", "create_full_iteration_space",
"create_sparse_iteration_space", "create_sparse_iteration_space",
"optimize_cpu",
] ]
from __future__ import annotations
from .context import KernelCreationContext
from ..platforms import GenericCpu
from ..ast.structural import PsBlock
from ...config import CpuOptimConfig
def optimize_cpu(
ctx: KernelCreationContext,
platform: GenericCpu,
kernel_ast: PsBlock,
cfg: CpuOptimConfig,
):
"""Carry out CPU-specific optimizations according to the given configuration."""
if cfg.loop_blocking:
raise NotImplementedError("Loop blocking not implemented yet.")
if cfg.vectorize is not False:
raise NotImplementedError("Vectorization not implemented yet")
if cfg.openmp:
raise NotImplementedError("OpenMP not implemented yet")
if cfg.use_cacheline_zeroing:
raise NotImplementedError("CL-zeroing not implemented yet")
...@@ -48,22 +48,6 @@ class FreezeExpressions: ...@@ -48,22 +48,6 @@ class FreezeExpressions:
TODO: Document the full set of supported SymPy features, with restrictions and caveats TODO: Document the full set of supported SymPy features, with restrictions and caveats
TODO: Properly document the SymPy extensions provided by pystencils TODO: Properly document the SymPy extensions provided by pystencils
TODO: This is a (possibly incomplete) list of SymPy language features that still need to be implemented:
- Augmented Assignments
- AddressOf
- Relations (sp.Relational)
- pystencils.sympyextensions.integer_functions
- pystencils.sympyextensions.bit_masks
- GPU fast approximations (pystencils.fast_approximation)
- ConditionalFieldAccess
- sp.Piecewise
- sp.floor, sp.ceiling
- sp.log, sp.atan2, sp.sinh, sp.cosh. sp.atan
- sp.Min, sp.Max: multi-argument versions
- Modulus (sp.Mod)
""" """
def __init__(self, ctx: KernelCreationContext): def __init__(self, ctx: KernelCreationContext):
......
...@@ -19,7 +19,7 @@ from ..ast.expressions import ( ...@@ -19,7 +19,7 @@ from ..ast.expressions import (
PsLookup, PsLookup,
) )
from ...types import PsVectorType, PsCustomType from ...types import PsVectorType, PsCustomType
from ..transformations.vector_intrinsics import IntrinsicOps from ..transformations.select_intrinsics import IntrinsicOps
class GenericCpu(Platform): class GenericCpu(Platform):
......
...@@ -9,7 +9,7 @@ from ..ast.expressions import ( ...@@ -9,7 +9,7 @@ from ..ast.expressions import (
PsAddressOf, PsAddressOf,
PsSubscript, PsSubscript,
) )
from ..transformations.vector_intrinsics import IntrinsicOps from ..transformations.select_intrinsics import IntrinsicOps
from ...types import PsCustomType, PsVectorType from ...types import PsCustomType, PsVectorType
from ..constants import PsConstant from ..constants import PsConstant
......
from .eliminate_constants import EliminateConstants from .eliminate_constants import EliminateConstants
from .erase_anonymous_structs import EraseAnonymousStructTypes from .erase_anonymous_structs import EraseAnonymousStructTypes
from .vector_intrinsics import MaterializeVectorIntrinsics from .select_intrinsics import MaterializeVectorIntrinsics
__all__ = [ __all__ = [
"EliminateConstants", "EliminateConstants",
......
...@@ -99,10 +99,10 @@ def create_kernel( ...@@ -99,10 +99,10 @@ def create_kernel(
erase_anons = EraseAnonymousStructTypes(ctx) erase_anons = EraseAnonymousStructTypes(ctx)
kernel_ast = cast(PsBlock, erase_anons(kernel_ast)) kernel_ast = cast(PsBlock, erase_anons(kernel_ast))
# 7. Apply optimizations # Target-Specific optimizations
# - Vectorization if config.target.is_cpu() and config.cpu_optim is not None:
# - OpenMP from .backend.kernelcreation import optimize_cpu
# - Loop Splitting, Tiling, Blocking optimize_cpu(ctx, platform, kernel_ast, config.cpu_optim)
assert config.jit is not None assert config.jit is not None
return create_kernel_function( return create_kernel_function(
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment