DEV Community

Discussion on: Who's looking for open source contributors? (Feb 25th edition)

Collapse
 
picocreator profile image
Eugene Cheah • Edited

gpujs / gpu.js

GPU Accelerated JavaScript

Logo

GPU.js

GPU.js is a JavaScript Acceleration library for GPGPU (General purpose computing on GPUs) in JavaScript. GPU.js will automatically compile simple JavaScript functions into shader language and run them on the GPU. In case a GPU is not available, the functions will still run in regular JavaScript.

Join the chat at https://gitter.im/gpujs/gpu.js Slack

What is this sorcery?

Matrix multiplication written in GPU.js:

const gpu = new GPU()
// Create the GPU accelerated function from a kernel
// function that computes a single element in the
// 512 x 512 matrix (2D array). The kernel function
// is run in a parallel manner in the GPU resulting
// in very fast computations! (...sometimes)
const matMult = gpu.createKernel(function(a, b) {
    var sum = 0
    for (var i = 0; i < 512; i++) {
        sum += a[this.thread.y][i] 

Shout out for a personal project im involved in - gpu.rocks/ - running JS in the GPU (via hackerish webgl).

robertleeplummerjr (the current main maintainer) is always looking for more contribution of ideas, and usage of this crazy project. And possibly just more random cool stuff on pushing the very upper limit of what a web-application could do.


PS: I dun see the comment template

Collapse
 
ben profile image
Ben Halpern

This is so cool.

Collapse
 
ben profile image
Ben Halpern

Oh whoops, I included the template in the last post and then copied and pasted this week without the template. Still not sure whether or not the template makes sense 😄