naive implementation
use local memory
use float4 instead of float
vectors for cn==2