title: CUDA kernel call in a simple sample
body: <p>It's the first parallel code of <em> cuda by example </em>. </p>
  
  <p>Can any one describe me about the kernel call : &lt;&lt;&lt; N , 1 >>> </p>
  
  <p>This is the code with important points : </p>
  
  <pre><code>#define N   10
  
  __global__ void add( int *a, int *b, int *c ) {
      int tid = blockIdx.x;    // this thread handles the data at its thread id
      if (tid &lt; N)
          c[tid] = a[tid] + b[tid];
  }
  
  int main( void ) {
      int a[N], b[N], c[N];
      int *dev_a, *dev_b, *dev_c;
  
      // allocate the memory on the GPU
      // fill the arrays 'a' and 'b' on the CPU
      // copy the arrays 'a' and 'b' to the GPU
  
      add&lt;&lt;&lt;N,1&gt;&gt;&gt;( dev_a, dev_b, dev_c );
  
      // copy the array 'c' back from the GPU to the CPU
      // display the results
      // free the memory allocated on the GPU
  
      return 0;
  }
  </code></pre>
  
  <p>Why it used of <code>&lt;&lt;&lt; N , 1 &gt;&gt;&gt;</code> that it means we used of N blocks and 1 thread in each block ?? since we can write this <code>&lt;&lt;&lt; 1 , N &gt;&gt;&gt;</code> and used 1 block and N thread in this block for more optimization. </p>