Optimize CPU kernel