WebGL2-compute matrix multiplication C = A x B (SGEMM) demo.
All A, B elements are random (0 - 1). Error "er1" is calculated as the sum of |CCPU - CGPU |/(N*N) for all matrix elements. er2 = max(|CCPU - CGPU |). M,K,N are multiple of 32,64,128.
See also SLM shader benchmark.
Intel highly optimised OpenCL kernel SLM_8x8_4x16 is used for the shader. I just replaced pointers by indexes and "unroll" mad() functions not supported by GLSL 310. The script is rather lengthy (they unroll cycles) see it in the page source.