Socket
Book a DemoInstallSign in
Socket

saltmine

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

saltmine

Arbitrary computation on the GPU using WebGL.

latest
Source
npmnpm
Version
1.0.0-alpha4
Version published
Maintainers
1
Created
Source

saltmine

Arbitrary computation on the GPU using WebGL.

Very experimental.

Installation

Usage

var saltmine = require('saltmine')
var multiline = require('multiline')

var input = [1,2,3]

var output = saltmine(input, multiline(function(){/*
  return a * 2.0; // double number
*/}))

// Result (Note float precision):
// [
//   2.0000001899999997,
//   4.0000003799999995,
//   6.00000044838664
// ]
var saltmine = require('saltmine')
var multiline = require('multiline')

var a = [1,2,3]
var b = [1,2,3]

var output = saltmine(a, b, multiline(function(){/*
  return a * b;
*/}))

// Result (Note float precision):
// [
//   1.0000000949999999,
//   4.0000003799999995,
//   9.00000042934544
// ]

Caveats

  • Overhead of setup/reading pixels generally makes calculations slower than just doing it on the CPU.

TODO

  • Support more datatypes. Everything is float now. Vectors and matrices possibly better candidates for parallel speedup.

Credit

Massive thanks to the talented @hughsk for pairing with me on this. Saved me from many wrong turns.

License

MIT

FAQs

Package last updated on 08 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts