Git Product home page Git Product logo

simd-arrays-functions's Introduction

@zkud/simd-arrays-functions

CI

npm package for Node.js-like envs with simd functions for typed arrays implemented with Rust and Vulcano.

Support matrix

Operating Systems

node12 node14 node16
Windows x64
Windows x32
Windows arm64
macOS x64
macOS arm64
Linux x64 gnu
Linux x64 musl
Linux arm gnu
Linux arm64 gnu
Linux arm64 musl
Android arm64
FreeBSD x64

Languages

Both TypeScript and JavaScript are supported.

Installing @zkud/simd-arrays-functions

You can install the package with npm. In the project directory, run:

$ npm install @zkud/simd-arrays-functions

Or you can install the package with yarn. In the project directory, run:

$ yarn add @zkud/simd-arrays-functions

Using @zkud/simd-arrays-functions

First we need to create typed arrays, Regarding supported types please check this documentation.

  const array1 = new Float64Array([1, 2, 3]);
  const array2 = new Float64Array([1, 2, 3]);
  const resultArray = new Float64Array(3);

Then we could use some operations, you could check the full list here.

  const { add, mul } = require('@zkud/simd-arrays-functions');

  add(array1, array2, resultArray);
  mul(array1, resultArray, resultArray);

And then we need to extract result values, the .values() method of typed arrays could be used:

  for(const value of resultArray.values) {
    console.log(value);
  }

simd-arrays-functions's People

Contributors

zkud avatar

Watchers

 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.