moving function definitions in device_util to .cc