[cpu-processing][gpu-processing] Moments optimization