Giter Site home page Giter Site logo

nimsimd's Introduction

nimsimd

Github Actions

nimble install nimsimd

This repo provides pleasant Nim bindings for various SIMD instructions.

Each SIMD instruction set is in its own file for importing.

Status

This repo is under development. Check back here for the latest status.

x86

Instruction Set Bindings
SSE
SSE2
SSE3
SSSE3
SSE4.1
SSE4.2
AVX
AVX2
PCLMULQDQ

Compiler flags

Some instruction sets require additional compiler flags to compile. I suggest putting any code that uses these instructions into its own .nim file and adding a localPassc pragma to the top of that file as needed, such as:

import nimsimd/sse42

when defined(gcc) or defined(clang):
  {.localPassc: "-msse4.2".}

...

Runtime check

You can also check if instruction sets are available at runtime:

import nimsimd/runtimecheck

echo checkInstructionSets({SSE41, PCLMULQDQ})

ARM

NEON bindings are started but experimental. Much to learn here about versioning and compilers.

Uses of nimsimd

  • Noisy uses SIMD to accelerate generating coherent noise.
  • Pixie uses SIMD for faster 2D drawing.

Testing

nimble test

nimsimd's People

Contributors

guzba avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.