title: Using Cuda for non-square matrix multiplication
body: <p>I started to work with cuda the last days. Writing a program which multiplies two matrices of the size N x N was no problem. In the kernel function I used this code:</p>
  
  <pre><code>    for(int i = 0; i &lt; width; i++){
          sum += a[row * width + i] * b[i * width + col];
          c[row * width + col] = sum;
      }
  </code></pre>
  
  <p>How do I have to design the kernel function to multiply a matrix of the size 1 x N with a matrix of the size N x M</p>