Member-only story

Using GPU.js in Angular

Compute matrix calculation using GPU in browser and Angular

Balram Chavan
3 min readFeb 18, 2021

In a typical client-server architecture, client is supposed to do a little processing of inputs and more of user interactions. A web client should capture user inputs and data and send it to a server where heavy computations will take place and result will be sent back to a client for presentation. This is/was the orthodox way of web application development. But with advancement in computer hardwares, browsers capabilities, power of JavaScript libraries, introduction of web workers, web assemblies (WASM) etc.; things are not the same, are they? Nowadays, a web client can do lots of pure computations in memory. The few examples are big data visualisation libraries like D3.js, games development using WebGL, applying math operations on big data using web workers at client side etc.

Nowadays, almost all desktops and laptops have a built-in General Purpose Graphics Processor Unit (GPGPU). These are powerful chips used for heavy computations which is generally required in graphics heavy games. But over the time period, programmers have found a way to apply GPGPU for other problems as well. On the server side, there are many toolkits and programming languages available for writing GPGPU code like CUDA but what if we can use client’s GPGPU to do our JavaScript heavy task? Interesting thought, isn’t it?

GPU.js

Recently, I came across a library called “GPU.js”, and got impressed by it. This library…

--

--

Balram Chavan
Balram Chavan

Written by Balram Chavan

Google Developer Expert Angular | Architect | Author | http://www.youtube.com/@angularcloud

No responses yet