I'm starting a project for browsers which requires some complex data processing. The algorithm I'm using is 50-100x faster when accelerated with GPU.
I could use JavaScript, Flash or other technologies with the browser. Is there any way I can access the GPU to accelerate the processing of my math?
Browsers like Google Chrome use GPU power even more than applications like Microsoft Office do. It is by default enabled in Chrome, Firefox, and Internet Explorer.
In short, GPU. js is a JavaScript acceleration library that can be used for general-purpose computations on GPUs using JavaScript. It supports browsers, Node. js and TypeScript.
Composition of layers whose contents are created directly on GPU works as follows: instead of rendering straight into the backbuffer, they render into a texture (using a Frame Buffer Object) that the compositor context grabs and uses when rendering that GraphicsLayer.
You could start experimenting with Khronos' WebCL, although that's still in its infancy. The big players like Internet Explorer, Chrome and Opera show no clear plans for support just yet, with Microsoft not even showing any plans for WebGL support.
That being said, apart from a WebGL shader based GPGPU approach, WebCL might be your best bet for computation. WebCL is in essence a set of JavaScript bindings to OpenCL. As such, developments are most likely to be closely linked to those of OpenCL.
While, as said, support for WebCL is as of this moment not yet standard nor widespread, there are currently the following resources available:
I have only started to play with it myself recently, but can't yet make any recommendations beyond "quite fun".
Since this old question was a top search hit for me on this topic, I thought I'd mention that some further exploration led me to gpu.js, which wraps WebGL in utility functions.
EDIT: ...and hopping through GitHub issues etc. from there led me to weblas as well. I don't have a comparison of these two yet, converting this answer to community wiki in case someone with experience in either of these sees this and has something to add.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With