add init code for device/cpu