title: Resolving Thrust/CUDA warnings "Cannot tell what pointer points to..."
body: <p>I'm trying to build a trivial application using Thrust/CUDA 4.0 and get lots of warnings "warning : Cannot tell what pointer points to, assuming global memory space"</p>
  
  <p>Has anyone else seen this and how do I either disable them or fix my code?</p>
  
  <p>Thanks,</p>
  
  <p>Ade</p>
  
  <p>Here's my code.</p>
  
  <p>Hello.h</p>
  
  <pre><code>class DECLSPECIFIER Hello   
  { 
  private:
      thrust::device_vector&lt;unsigned long&gt; m_device_data;
  
  public:
      Hello(const thrust::host_vector&lt;unsigned long&gt;&amp; data);
      unsigned long Sum();
      unsigned long Max();
  };
  </code></pre>
  
  <p>Hello.cu</p>
  
  <pre><code>#include "Hello.h"
  
  Hello::Hello(const thrust::host_vector&lt;unsigned long&gt;&amp; data)
  {
      m_device_data = data;
  }
  
  unsigned long Hello::Sum()
  {
      return thrust::reduce(m_device_data.cbegin(), m_device_data.cend(), 0, thrust::plus&lt;unsigned long&gt;());
  }
  
  unsigned long Hello::Max()
  {
      return *thrust::max_element(m_device_data.cbegin(), m_device_data.cend(), thrust::less&lt;unsigned long&gt;());
  }
  </code></pre>
  
  <p>The output </p>
  
  <pre><code>1&gt;  Compiling CUDA source file Hello.cu...
  1&gt;  
  1&gt;  C:\SrcHg\blog\HelloWorld\HelloWorldCuda&gt;"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\bin\nvcc.exe" -gencode=arch=compute_10,code=\"sm_10,compute_10\" --use-local-env --cl-version 2008 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 9.0\VC\bin"  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include"  -G0  --keep-dir "Debug" -maxrregcount=32  --machine 32 --compile  -D_NEXUS_DEBUG -g    -Xcompiler "/EHsc /nologo /Od /Zi  /MDd " -o "Debug\Hello.cu.obj" "C:\SrcHg\blog\HelloWorld\HelloWorldCuda\Hello.cu" 
  1&gt;  Hello.cu
  1&gt;  tmpxft_00001fac_00000000-0_Hello.cudafe1.gpu
  1&gt;  tmpxft_00001fac_00000000-5_Hello.cudafe2.gpu
  1&gt;  Hello.cu
  1&gt;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include\thrust/detail/internal_functional.h(197): warning : Cannot tell what pointer points to, assuming global memory space
  1&gt;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include\thrust/detail/internal_functional.h(197): warning : Cannot tell what pointer points to, assuming global memory space
  1&gt;C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v4.0\include\thrust/detail/internal_functional.h(197): warning : Cannot tell what pointer points to, assuming global memory space
  </code></pre>
  
  <p>There's a lot of these.</p>