Move common cpu-related algorithm to core_algorithm.