Skip to content

About

Portable SIMD float library in C: AVX2/SSE2/NEON/scalar backends picked at runtime via CPUID, stride-based N-d arrays with broadcasting, lazy expression evaluation, and a radix-2 FFT

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simd-engine

A small SIMD numerical library in C. A dispatch table picks AVX2, SSE2, ARM NEON or scalar implementations at runtime from CPUID, and on top of that sit N-dimensional float arrays and an FFT.

Features

  • SIMD layer: 8-float vector type with add, mul and fused multiply-add (AVX2 with FMA, SSE2, scalar), chosen at runtime with CPUID
  • Arrays: N-dimensional float arrays with a stride-based layout, views, and broadcasting
  • Expressions: a lazy expression tree (add, mul, scalar mul) evaluated in one pass over the output, with no temporary arrays
  • FFT: radix-2 FFT with precomputed twiddle factors and an AVX2 path, plus inverse and real-input variants

Layout

include/    headers (simd_abstraction.h, array.h, fft.h)
src/        simd_abstraction.c, array.c, fft.c
tests/      test_simd.c, test_array.c, test_fft.c
Makefile

Build and test

Requires gcc on x86-64 (the Makefile uses -mavx2 -msse2 -mfma -fopenmp).

make test-simd
make test-array
make test-fft      # test_fft.c includes windows.h, so Windows only for now
make clean

Example

simd_dispatch_t* d = simd_init_dispatch();
simd_vec_t a = simd_load(x), b = simd_load(y);
simd_store(out, d->add(a, b));
simd_free_dispatch(d);

About

Portable SIMD float library in C: AVX2/SSE2/NEON/scalar backends picked at runtime via CPUID, stride-based N-d arrays with broadcasting, lazy expression evaluation, and a radix-2 FFT

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages