Merge "cpu_ref: fix c++11 narrowing violations"