Giter VIP home page Giter VIP logo

hamming_weight's Introduction

hamming_weight

C library to compute the Hamming weight of arrays. The Hamming weight is the number of ones in a stream of bits. Computing this count quickly has important applications in indexing, machine learning, cryptography and so forth.

Library has several highly optimized implementations, which use popcnt, SSE, AVX2, and AVX512 instructions.

Please note that an AVX512F variant is under development, AVX512BW is just a proof of concept (no hardware support yet), and AVX512CD was written to show it's feasible.

Paper

Faster Population Counts using AVX2 Instructions

Usage

make
./unit
./basic_benchmark

Building

It's assumed that target CPU supports both AVX2 and popcnt.

  • If a CPU doesn't support AVX2 define SSE.
  • If a CPU doesn't support popcnt instruction then define NOPOPCNT.
  • If you want to build AVX512 variants, define AVX512F or AVX512BW or AVX512CD.
  • If you want to build for AMD XOP, define XOP.

For example:

export SSE=1 NOPOPCNT=1; make
./basic_benchmark

export AVX512F=1; make
./basic_benchmark

hamming_weight's People

Contributors

lemire avatar openluopworld avatar wojciechmula avatar

Watchers

 avatar  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.