Add a scalar max calculation to Device.