User Manual

Intro

Features

Simdy decorator

Kernel class

Intro

SIMDy is compiler that transforms python code to native machine code. A number of Python features can be used inside of a kernel. They include expressions, functions, user-defined classes, conditionals, while loop. Inside of kernel only SIMDy data types are allowed to be used. Supported basic data types are integers, reals(floats) and vector data types. You can see list of all avaliable data types in reference section. Kernel code is strongly typed and all conversions beetween types must be done explicitly. To achieve high performance it is recommended to use vector data types which are directly translated to SIMD instructions. Compilation can be invoked automatically when calling a function that uses the @simdy_kernel decorator or using Kernel class. We will start with @simdy_kernel decorator first.

Simdy decorator

from simdy import simdy_kernel, float64

@simdy_kernel
def add(a: float64, b: float64) -> float64:
    return a + b

result = add(float64(33), float64(-5))
print(result)

Language Features

SIMDy supports subset of Python language features.

Kernel class