News for hackers. Stuff that matters.
Re:An Introduction to GPU Programming in Julia by pjmlp on Thursday October 18, 2018 @05:35PM (#18252341)
WebGL compute shaders are being discussed, it might be a possible improvement to your library when they finally get adopted.
Re:An Introduction to GPU Programming in Julia by johndough on Thursday October 18, 2018 @06:02PM (#18252547)
Are there any news on WebGL compute shaders?

I remember OpenCL for Firefox being discussed and discarded in favor of compute shaders about 7 years ago, and then when WebGL 2.0 was finally released 5 years later, compute shaders were not part of it.

Additionaly, SIMD.js has been developed and then killed again and support for SIMD in WebAssembly has been delayed, so I don't believe that we'll be able to implement efficient numerical methods in the browser any time soon.

Re:An Introduction to GPU Programming in Julia by pjmlp on Friday October 19, 2018 @01:27AM (#18254412)
Re:An Introduction to GPU Programming in Julia by fulafel on Friday October 19, 2018 @04:05AM (#18254953)
Note that you can do GPGPU with the current WebGL, compute shaders don't have that many additional capabilities unless you are looking do computation without interference from from onscreen WebGL graphics.

For a future GPGPU web api, the vendors seem to have settled behind https://github.com/gpuweb/gpuweb/

Re:An Introduction to GPU Programming in Julia by obl on Thursday October 18, 2018 @09:38PM (#18253736)
I wonder how they are going to pull that off without security implications.

If you've played with compute shaders (or any of the modern "general purpose" shader stuff, ie arbitrary loads & stores etc) you probably know that it's quite easy to crash drivers. Of course you do so generally by provoking some form of UB (although not always, their runtime/compilers are far from bug-free).

But WebGL can't have that, so I don't see how they could pull that off without adding a ton of runtime bound checks to shaders, like they do for index buffers right now but on the GPU side this time.

Not only would that be bad for performance, but I still would never trust this whole stack to run arbitrary code.

Re:An Introduction to GPU Programming in Julia by fulafel on Friday October 19, 2018 @12:10AM (#18254185)
Compute shaders are no different in this regard from other types of shaders that are currently supported by WebGL. They have the same capabilities and data types as other shaders. The difference is when they are invoked and the lack of implicit inputs/outputs. This is needed to perform computation out of lockstep with the graphics pipeline when you are also rendering graphics.

The existing WebGL 1 & WebGL 2 shader compilation process does involve "a ton of checks", shaders are recompiled to have known safe memory accesses, eliminate uninitialized memory/variables, etc.

Usually in compiler technology bounds checking does not involve a big cost as static sizes are zero cost and most dynamic checks can be hoisted out of loops.