compile error on device_vector<int>, where host_vector<int> produces correct answers

compile error on device_vector,where using host_vector in the same code executes successfully