title: using thrust device_vector as global variable
body: <p>Why does the following code crash at the end of the main?</p>
  
  <pre class="lang-cuda prettyprint-override"><code>#include &lt;thrust/device_vector.h&gt;
  
  thrust::device_vector&lt;float4&gt; v;
  
  int main(){
      v.resize(1000);
      return 0;
  }
  </code></pre>
  
  <p>The error is:</p>
  
  <pre><code>terminate called after throwing an instance of 'thrust::system::system_error'
  what():  unspecified driver error
  </code></pre>
  
  <p>If I use <code>host_vector</code> instead of <code>device_vector</code> the code run fine.</p>
  
  <p>Do you think it's a Thrust bug, or am I doing something wrong here?</p>
  
  <p>I tried it on ubuntu 10.10 with cuda 4.0 and on Windows 7 with cuda 6.5.
  The Thrust version is 1.7 in both cases.</p>
  
  <p>thanks</p>