title: using std::bind2nd with thrust
body: <p>I'm trying to use std::bind2nd with thrust. I have code that compiles with a host pointer, but not with a device pointer. I think they are identical and should work in both cases.</p>
  
  <pre><code>// this compiles fine
  thrust::host_vector&lt;unsigned int&gt; h_vec(nwords);
  thrust::host_vector&lt;unsigned int&gt; h_map(nwords);
  thrust::host_vector&lt;unsigned int&gt; h_out1(nwords);
  thrust::copy_if(h_vec.begin(), h_vec.end(), h_map.begin(), h_out1.begin(), 
                  std::bind2nd(thrust::equal_to&lt;int&gt;(),1));
  
  // this compilation fails with the error below
  thrust::device_vector&lt;unsigned int&gt; d_map(nwords);
  thrust::device_vector&lt;unsigned int&gt; d_vec(nwords);
  thrust::device_vector&lt;unsigned int&gt; d_out1(nwords);
  thrust::copy_if(d_vec.begin(), d_vec.end(), d_map.begin(), d_out1.begin(), 
                  std::bind2nd(thrust::equal_to&lt;int&gt;(),1));
  </code></pre>
  
  <p>When I try to call the second copy_if with the bind2nd I get the error below:</p>
  
  <pre><code> /opt/cuda/include/thrust/detail/internal_functional.h(99): warning: calling a
   __host__ function from a __host__ __device__ function is not allowed
  </code></pre>
  
  <p>Is there another way to using adapters for binary functions in thrust? I have seen some people using "thrust::bind2nd" in examples on the web but I can't find that in any of our header files.</p>