Optimization to building neighbor list on CPU platform