title: call cuda from c results in errors
body: <p>The errors I am receiving are:</p>
  
  <blockquote>
    <p>‘blockIdx’ was not declared in this scope 
    expected primary-expression before ‘&lt;’ token</p>
    
    <p>expected primary-expression before ‘>’ token</p>
    
    <p>expected primary-expression before ‘&lt;’ token</p>
    
    <p>expected primary-expression before ‘>’ token</p>
  </blockquote>
  
  <p>(the "&lt;,>" refers to the kernel call &lt;&lt;&lt;>>>)</p>
  
  <p>Also,in main function I receive:</p>
  
  <blockquote>
    <p>error: cannot convert ‘float*<em>’ to ‘float</em>’ for argument ‘1’ to ‘void
    kernel_wrapper(float*, float*, int, int)</p>
  </blockquote>
  
  <p>cu file:</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstdio&gt;
  #include &lt;cstdlib&gt;
  #include &lt;math.h&gt;
  #include &lt;curand_kernel.h&gt;
  #include &lt;cuda_runtime.h&gt;
  #include &lt;cuda.h&gt;
  
  .....
  __global__ void kernel(float* A,float *B, curandState* globalState, int Asize,int Bsize)
  {
  ...
  
  void kernel_wrapper(float* A_host,float* B_host, int Asize ,int Bsize)
  {
  ...
  //allocate host memory 
      A_host=(float*)malloc(Asize*sizeof(float));
      B_host=(float*)malloc(Bsize*sizeof(float));
  
      //allocate device memory
      float* A_dev,*B_dev;
      cudaMalloc((void**) &amp;A_dev,Asize* sizeof(float));
      cudaMalloc((void**) &amp;B_dev,Bsize* sizeof(float));
  ....
  
   kernel&lt;&lt;&lt;1,1&gt;&gt;&gt;(A_host,B_host, devStates,Asize,Bsize);
  ...
  </code></pre>
  
  <p>c file:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;stdlib.h&gt;
  #include &lt;string.h&gt;
  #include &lt;sys/time.h&gt;
  #include &lt;string.h&gt;
  #include &lt;assert.h&gt;
  #include &lt;stdarg.h&gt;
  #include &lt;cuda.h&gt;
  #include &lt;cuda_runtime.h&gt;
  #include "solve.cu"
  
  
  extern void kernel_wrapper(float* A,float* B, int Asize ,int Bsize);
  ...
  int main()
  {...
  A = (float*)malloc(N*N*sizeof(float));
  B = (float*)malloc(N*HS*sizeof(float));
  ...
  kernel_wrapper(A,B,Asize ,Bsize);
  ...
  </code></pre>
  
  <p>I am compiling as:</p>
  
  <pre><code> g++ -o mycode myfile.c -I/usr/local/cuda-5.5/include -L/usr/local/cuda-5.5/lib64 -lcurand -lcutil -lcudpp -lcuda -lstdc+
  </code></pre>