title: External calls are not supported - CUDA
body: <p>Objective is to call a device function available in another file, when i compile the <strong>global</strong> kernel it shows the following error <strong>*External calls are not supported (found non-inlined call to _Z6GoldenSectionCUDA)*</strong>.</p>
  
  <p>Problematic Code (not the full code but where the problem arises),
  cat norm.h </p>
  
  <pre><code># ifndef NORM_H_
  # define NORM_H_
  # include&lt;stdio.h&gt;
  
  __device__ double invcdf(double prob, double mean, double stddev);
  
  #endif
  </code></pre>
  
  <p>cat norm.cu</p>
  
  <pre><code># include &lt;norm.h&gt;
  
  __device__ double invcdf(double prob, double mean, double stddev) {
      return (mean + stddev*normcdfinv(prob));
         }
  </code></pre>
  
  <p>cat test.cu</p>
  
  <pre><code># include &lt;norm.h&gt;
  # include &lt;curand.h&gt;
  # include &lt;curand_kernel.h&gt;
  
  __global__ void phase2Kernel(double* out_profit, struct strategyHolder* strategy) {
         curandState seedValue;
         curand_init(threadIdx.x, 0, 0, &amp;seedValue);
         double randomD = invcdf(curand_uniform_double( &amp;seedValue ), 300, 80);
      }
  </code></pre>
  
  <p>nvcc -c norm.cu -o norm.o -I"."<br>
  nvcc -c test.cu -o test.o -I"."</p>