invalid device function during creation of thrust::device_vector<std::int64_t>

I have CUDA application which I want to use multi GPUs. Firstly I’m testing it on single GPU with setting device always to zero (cudaSetDevice(0)). I use thrust library and create a lot of device_vectors. During creation of them:

thrust::device_vector<std::int64_t> tmp;  // class private vector
 tmp = thrust::device_vector<std::int64_t>(100);  // inside constructor of the class

I got an error:

terminate called after throwing an instance of 'thrust::system::system_error'
  what():  function_attributes(): after cudaFuncGetAttributes: invalid device function

Why it happens? I’ve set device to zero, and all other device_vectors which were created before (in other part of my application) had been created properly. I’ve tried with changing tmp to device_vector pointer and create with ‘new’ keyword but it doesn’t help.
I use GTX950 and build with Compute Capability set to 52 (as should be).