K φ° Δt/h2 delay fps

Schrödinger equation on 256×256 square grid. |Ψ|2 for the travelling wave packet is plotted. Colors correspond to the wave function phase. Ψ = 0 at the square border. Data are stored in buffers.

The main kernel (see Schrödinger equation)

constant int n = 256, m = 255, sh = 8;

__kernel void kRelax(global float2* in0, global float2* in2,
    global float2* outp, float cx, float cy){
  int x = get_global_id(0),  y = get_global_id(1),  a = x + (y<= m || y >= m) return;
  float2 t = in2[a] + in0[a + 1] + in0[a - 1] + in0[a + n] + in0[a - n];
  outp[a] = (float2)(cx*t.x - cy*t.y, cy*t.x + cx*t.y);
}
Again this script is slow enough.
WebCL Demos     updated 25 Sep 2014