title: Issue in OpenCL Kernel function
body: <p>I am new to Open-cl and I am trying to write kernel code for the following matrix operation:</p>
  
  <pre><code>A is a 2X2 matrix:
  A = [1  2] ----&gt; row1
      [3  4] -----&gt;row2
  
  I need to compute: 
  1) s1 = transpose(row1) X row1
  2) s1 = transpose(row2) X row2
  3) Sum = s1+s2
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/kAWoY.png" alt="Example"></p>
  
  <p>I wrote kernel code for row level (i.e I can do transpose(row1) X row1 )
  -this serves the purpose for first row only</p>
  
  <p>How do I use parallelism to compute this for each row and find the final sum within kernel function ?</p>
  
  <pre><code>private static String programSource1 =
              "__kernel"+
              " void matrixMul(__global float* A, __global float* C,  int rowLength)"+
              "{"+
                  "int row = get_global_id(1);"+
                  "int col = get_global_id(0);"+              
                      "C[row*rowLength+col] = A[col] * A[row];"+
  
              "}";
  </code></pre>