Platforms#

All target-specific code generation in the pystencils backend is facilitated through the platform classes. This includes:

  • Materialization of the iteration space, meaning the mapping of iteration space points to some indexing structure

  • Lowering of mathematical functions to their implementation in some runtime environment

  • Selection of vector intrinsics for SIMD-capable CPU targets

Encapsulation of hardware- and environment-specific details into platform objects allows us to implement most of the code generator in a generic and hardware-agnostic way. It also makes it easier to extend pystencils with support for additional code generation targets in the future.

Base Classes#

Platform

Abstract base class for all supported platforms.

GenericCpu

Generic CPU platform.

GenericVectorCpu

Base class for CPU platforms with vectorization support through intrinsics.

CPU Platforms#

X86VectorCpu

Platform modelling the X86 SSE/AVX/AVX512 vector architectures.

X86VectorArch

An enumeration.

GPU Platforms#

GenericGpu

Common base platform for CUDA- and HIP-type GPU targets.

CudaPlatform

Platform for the CUDA GPU taret.

HipPlatform

Platform for the HIP GPU taret.

Experimental Platforms#