Code Monkey home page Code Monkey logo

accel_sort's Introduction

accel-sort

npm version

A high performance sorting library for Javascript. Get up to 70x speedup when sorting ints and floats

Speedup Chart

Prerequisites

  • NVIDIA GPU with CUDA Compute Capability (5.0 or higher)
  • Node.js (Version 12.x or higher)
  • CUDA Version 12.4 installed

Installation

Run npm install accel-sort

Building from source

Make sure you have nvcc installed on your system, then simply run

npm install

Usage

Simply import the AccelSort with the following:

const AccelSort = require("accel-sort");

Within AccelSort, pass it the specified array types and size to their dedicated functions:

sortIntegers:

let array = new Int32Array([3, 1, 2]);
let buffer = Buffer.from(array.buffer);
AccelSort.sortIntegers(buffer, array.length);

sortFloat:

let array = new Float32Array([5.8, -10.7, 1507.6563, 1.0001]);
let buffer = Buffer.from(array.buffer);
AccelSort.sortFloats(buffer, array.length);

After that, the original array object will be correctly sorted in place

Contributions

Contributions are welcome! Please submit a pull request or open an issue to discuss proposed changes or additions.

License

Distributed under the MIT License. See LICENSE for more information.

accel_sort's People

Contributors

leoforney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

accel_sort's Issues

Pre-compile packages for targets

Having prebuilt packages available to download will be alot easier for getting started. Must target:

  • Linux
  • Windows
  • macOS (maybe?)

In addition to different architectures

  • arm64
  • amd64/x86_64

And if possible, targeting different CUDA versions would be ideal

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.