OptimizedCPUversion

faster CPU and used __constant__ memory for GPU for speedup