wrap initialization and device functions