title: CUDA External calls not supported
body: <p>I am developing a CUDA 4.0 application running on a Fermi card. According to the specs, Fermi has Compute Capability 2.0 and therefore should support non-inlined function calls.</p>
  
  <p>I compile every class I have with nvcc 4.0 in a distinct obj file. Then, I link them all with g++-4.4.</p>
  
  <p>Consider the following code :</p>
  
  <p>[File A.cuh]</p>
  
  <pre><code>#include &lt;cuda_runtime.h&gt;
  
  struct A
  {
      __device__ __host__ void functionA();
  };
  </code></pre>
  
  <p>[File B.cuh]</p>
  
  <pre><code>#include &lt;cuda_runtime.h&gt;
  
  struct B
  {
      __device__ __host__ void functionB();
  };
  </code></pre>
  
  <p>[File A.cu]</p>
  
  <pre><code>#include "A.cuh"
  #include "B.cuh"
  
  void A::functionA()
  {
      B b;
      b.functionB();
  }
  </code></pre>
  
  <p>Attempting to compile A.cu with <code>nvcc -o A.o -c A.cu -arch=sm_20</code> outputs <code>Error: External calls are not supported (found non-inlined call to _ZN1B9functionBEv)</code>.</p>
  
  <p>I <em>must</em> be doing something wrong, but what ?</p>