Inspiration

CUDA

What it does

Parallel computation using WebGL API on browser with graceful javascript fallback

How I built it

Using javascript, JISON to make a compiler and lots of pain.

Challenges I ran into

Compiler was hard.

Accomplishments that I'm proud of

Actually faster than CPU when workload too huge. Compiler actually works, somewhat.

What I learned

Not to make a compiler during a hackathon.

What's next for GPU.js

More syntax support, maybe higher order functions.

PLEASE RUN ON CHROME THANKS

Built With

Share this project:
×

Updates

Fazli Sapuan posted an update

Hi guys! If you have ran our benchmark previously just to point a minor error in our benchmark which caused the wrong output to be produced due to very severe overflow (rookie mistake, sorry we missed this!). But luckily the performance was still representative of the actual thing, just that the answers were off by about an Infinity or so.

Previous the computation in the for loop reads:

res += Math.sqrt( Math.pow( a[this.thread.x] , b[this.thread.x] ) );

Now it reads:

res += Math.sqrt( a[this.thread.x] * b[this.thread.x] ) / 500000;

If you like to check the output for correctness we have now output it to the javascript console for you to verify.

We will be releasing this project as a single file js library soon after a major rework of the compiler to do things The Right Way(tm) over our current voodoo ways.

The benchmark is not fake at all, have faith in us :*)

Log in or sign up for Devpost to join the conversation.