npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

milsushi2

v0.0.2

Published

The Fastest Matrix Library for JavaScript http://mil-tokyo.github.io/miljs.html

Downloads

4

Readme

Sushi2 library

Matrix Library for JavaScript

This library is intended to be the fastest matrix library for JavaScript, with the power of GPU computing. To gain best performance, WebCL technology is used to access GPU from JavaScript.

Interactive getting started on the browser

Documents (work in progress)

Build for use in node.js

Since this project is written in TypeScript, transpiling to JavaScript is necessary.

Package from npm repository contains transplied JavaScript, so simply installing them is enough.

npm install milsushi2

If you intend to modify code, download and build.

git clone https://github.com/mil-tokyo/sushi2
cd sushi2
npm install
npm run build

Sushi2 depends on node-opencl for GPU computing which allows dramatically faster computation. This dependency is optional, so even the installation of node-opencl fails, Sushi2 can work without it.

In my environment (Ubuntu 14.04 + NVIDIA CUDA 7.5), installation with node-opencl requires additional environment variables.

CPLUS_INCLUDE_PATH=/usr/local/cuda/include LIBRARY_PATH=/usr/local/cuda/lib64 npm install milsushi2

Build for use in web browser

For simply using the library, download the js file from releases page.

To make single JavaScript file for web browsers, type the following commands:

git clone https://github.com/mil-tokyo/sushi2
cd sushi2
npm install
npm run build
npm run browserify

This will generate browser/milsushi2.js (without WebCL support), and browser/milsushi2_cl.js (WebCL support version).

Usage in node.js

You can import the module by require('milsushi2').

Hello world in node shell

var $M = require('milsushi2');
$M.initcl();//OpenCL initialization, true if succeeds
var x = $M.jsa2mat([[1,2],[3,4]]);
var y = $M.jsa2mat([[0.1,0.5],[0.7,0.0]]);
$M.plus(x, y);

Usage in web browser

By loading them from html page (<script src="milsushi2.js"></script>), milsushi2 global object is generated.

Hello world in html

<script>
var $M = milsushi2;
var x = $M.jsa2mat([[1,2],[3,4]]);
var y = $M.jsa2mat([[0.1,0.5],[0.7,0.0]]);
alert($M.plus(x, y));
</script>

To use WebCL for GPU computing, use milsushi2_cl.js instead of milsushi2.

Unfortunately, currently a plugin is needed to enable WebCL. We tested on webcl-firefox plugin with Firefox 32. Compiled version of webcl-firefox plugin for Linux is here (Ubuntu 14.04 + CUDA 7.5, commit d87447f, License: MPL 2.0).

If WebCL is enabled, $M.initcl() should return true.

License

MIT