Skip to content

njroussel/Kr8md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kr8md

Header-only SIMD C++ library

Table of Contents

Features

  • Basic arithmetic operators
  • Logic operators
  • Implitcit type conversions
  • Vector size is determined at compile-time
  • Supports SSE4.2 and AVX2

Demo

// Declare pa(c)ked types - their width is determinded at compile-time to match
// the largest possible vector register size for the target architecture.
pfloat x = ...;

if any(x > 2.0f) {
  masked(x, x < 3.5f) = x * x; // Use masks to select specific lanes
}

// Store vectorized outputs to arrays
float buffer[pfloat::width];
store(&buffer, x);

A working implementation of the mandelbrot fractal is implemented in kr8md_demo.cpp.

About

A small SIMD/SPMD C++ library

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published