declaration and copy to device done