give copyToDevice and copyFromDevice optional size arguments