title: Kernel invocation produces error "error: a host function call cannot be configured". What is wrong with the invocation?
body: <p>When compiling the following piece of code using nvcc -c mag_cuda.cu:</p>
  
  <pre><code>//Standard Libraries
  #include &lt;iostream&gt;
  #include &lt;math.h&gt;
  #include &lt;vector&gt;
  
  //Project Specific Header
  #include "mag.hpp"
  
   __global__
    void indv_B_components(int *self_coords, int pole_coords[][3], double *indv_B[][3], int No_poles, int counter_1)
    {
      some code......
    }
  
    //----------------------------------------------------------
    //------- Function to Calculate B Field at Each Pole -------
    //----------------------------------------------------------
    void calc_indv_B()
    {
      //declare namepspace for internal variables
      using namespace mag::internal;
  
      int *ppole_coords = &amp;pole_coords[0][0];
      double *pindv_B;
      int self_coords[3];
  
      int num_threads_in_block = 256;
      int num_blocks = 32*2;
  
      cudaMallocManaged(&amp;pindv_B, No_poles*3*sizeof(int));  
  
  
      //first loop to go over all poles
      for(int counter_1 = 0; counter_1 &lt; No_poles; counter_1++)
        {
        //store coords of the current pole
        self_coords[0] = pole_coords[counter_1][0];
        self_coords[1] = pole_coords[counter_1][1];
        self_coords[2] = pole_coords[counter_1][2];
  
  
        indv_B_components&lt;&lt;&lt;num_blocks, num_threads_in_block&gt;&gt;&gt;(self_coords, ppole_coords,  pindv_B, No_poles, counter_1); 
  
  
  
        cudaDeviceSynchronize();
        }
  
      cudaFree(pindv_B);
  
      //return from function
      return;
    }
  </code></pre>
  
  <p>The following error is returned:</p>
  
  <p>error: a host function call cannot be configured</p>
  
  <p>Which refers to the line</p>
  
  <pre><code>indv_B_components&lt;&lt;&lt;num_blocks, num_threads_in_block&gt;&gt;&gt;(self_coords, ppole_coords,  pindv_B, No_poles, counter_1); 
  </code></pre>
  
  <p>Since all the parameters are defined and the kernel the host device is calling a declared as <code>__global__</code> i don't know what could be causing this.</p>
  
  <p>The header file mag.hpp is:</p>
  
  <pre><code>//make sure MAG_H_ module hasnt been defined multiple times
  #ifndef MAG_H_
  #define MAG_H_
  
  //standard libraries
  #include &lt;iostream&gt;
  #include &lt;math.h&gt;
  #include &lt;vector&gt;
  
  
  //Namespace for module
  namespace mag
  {
  
  
    //define functions
    ...
  
  
    void indv_B_components(int *self_coords, int *pole_coords, double *indv_B, int No_poles, int counter_1);
  
    void calc_indv_B();
  
    ...
  }
  #endif //MAG_H_
  
  </code></pre>
  
  <p>Any help?</p>