Hardware makers have seen their shares rally this year amid an arms race for artificial intelligence computing power that’s lifting sales and profits.