# GPU.js

A JavaScript library that transpiles ordinary functions into shader code so they run accelerated on the GPU in the browser or Node, falling back to plain JavaScript when no GPU is available.

GPU.js is a general-purpose GPU computing (GPGPU) library for JavaScript. It automatically transpiles simple JavaScript functions into shader language and compiles them to run on the GPU, computing elements of an array or matrix in parallel; when no GPU is present, the same functions still run as regular JavaScript.

It works in both the browser, via a CDN build, and in Node through an npm package, and includes a kernel API for defining GPU-accelerated computations such as matrix multiplication.

An upcoming major version changes every kernel call to return a Promise, since WebGL's synchronous readback blocks the main thread for the duration of a GPU operation; code already written against the newer async mode is unaffected by the change.

Website: https://gpu.rocks
